Download presentation
Presentation is loading. Please wait.
Published byNoel Harry Stephens Modified over 8 years ago
1
Hints - Mandatory 5 Blackbox Testing Pattern Hunting
2
The UML Trap … which several TAs have fallen into… What is UML ? –1) A visual representation of a program –2) A visual language for expressing architecture Henrik Bærbak Christensen2
3
Then what is this? 1) An interface with a reference to an interface –Can we do that in Java? Henrik Bærbak Christensen3
4
And in Python Python has no interface language construct –But is an OO language Python uses ‘duck typing’ –Suitability is determined by the presence of methods, not by the object’s type Henrik Bærbak Christensen4
5
And in Python Python has no interface language construct –But is an OO language Can I realize this architecture in Python? Henrik Bærbak Christensen5
6
It is not a problem Just more ‘docs and conventions’ Henrik Bærbak Christensen6
7
The PayStation Henrik Bærbak Christensen7
8
And The Strategies I dealy miss my declared interface! –But ‘if it calculates time, it is a RateStrategy’ Henrik Bærbak Christensen8
9
The Bottom Line In FRS, UML expresses architecture Any implementation of PayStation ever must have a relation to a RateStrategy! –It is my architectural decision, and binds any who implements PayStation! Henrik Bærbak Christensen9
10
The Other Way If I had made the binding on PayStationImpl –PayStationImpl <>---- RateStrategy What had I then expressed as an architect??? Any Suggestions… Henrik Bærbak Christensen10
11
The TA Confusion Several hand-ins have been rejected that drew aggregations between Game interface and e.g. WinnerStrategy interfaces. – TAs are humans and make mistakes –(Even the lecturer makes mistakes ) Talk to me and the TAs… Henrik Bærbak Christensen11
12
The Parametric Trap Sneaks in everywhere! Henrik Bærbak Christensen12
13
Henrik Bærbak Christensen13 Parametric design
14
Remedies It is a well known liability of the Strategy pattern that it may need to expose methods that are only relevant for some of its algorithm implementations… Henrik Bærbak Christensen14 Benefits Avoid bloats of switches Liability Less cohesion in Strategy Benefits Avoid bloats of switches Liability Less cohesion in Strategy
15
And …
16
The Heuristics Set or Boolean? Coverage and preconditions Four identificerede invalide ECs: r 15 [2] c 15 [5] –Fine to document them as ECs! But test cases ??? Henrik Bærbak Christensen16
17
Decorator How to ‘decorate and undecorate’? Name problems with this solution? Name a proper solution... Henrik Bærbak Christensen17
18
Non-Decorator Decorator adds behaviour – it does not invalidate it! Henrik Bærbak Christensen18
19
Next: About GUI for HotCiv Remember the virtues of TDD! Keep focus, take small steps –Download the NEW zip, unzip, and run the targets = green bar –Move one test class from your hotciv into folder struct. Loop until compile ok { move missing class into this struct } Henrik Bærbak Christensen19
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.