






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







1.1 What is Design Pattern?
Structure Figure 1
Structure Figure 3
Example: Figure 4 Line, Rectangle and Text define primitive graphical objects which each define specific draw() methods. Picture defines an aggregate of Graphic objects and draw() calls draw() for all component objects. The abstract Graphic class declares all methods common to simple and composite objects. Code: http://www.dofactory.com/Patterns/PatternComposite.aspx#csharp 1.3 Behavioral Patterns 1.3.1 Command Intent: Encapsulate a request as an object, thereby letting you
Code : http://www.dofactory.com/Patterns/PatternCommand.aspx#csharp 1.3.2 Template Method Design Pattern Intent
Example Figure 8 Code: http://www.dofactory.com/Patterns/PatternTemplate.aspx#csharp 1.3.3 Observer Intent
2.1 What is JUnit? JUnit is an open source Java testing framework used to write and run repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. JUnit features include: Assertions for testing expected results Test fixtures for sharing common test data Test suites for easily organizing and running tests Graphical and textual test runners 2.2 Design of JUnit Figure 11 JUnit is designed around the following patterns: the Command pattern, the Composite pattern, and the template pattern. A TestCase is a command object. Any class that contains test methods should subclass the TestCase class. A TestCase can define any number of public testXXX() methods. When you want to check the expected and actual test results, you invoke a variation of the assert() method.
TestCase subclasses that contain multiple testXXX() methods can use the setUp() and tearDown() methods to initialize and release any common objects under test, referred to as the test fixture. Each test runs in the context of its own fixture, calling setUp() before and tearDown() after each test method to ensure there can be no side effects among test runs. TestCase instances can be composed into TestSuite hierarchies that automatically invoke all the testXXX() methods defined in each TestCase instance. A TestSuite is a composite of other tests, either TestCase instances or other TestSuite instances. The composite behavior exhibited by the TestSuite allows you to assemble test suites of test suites of tests, to an arbitrary depth, and run all the tests automatically and uniformly to yield a single pass or fail status. 2.3 What is extreme programming? Extreme Programming (XP) was conceived and developed to address the specific needs of software development conducted by small teams in the face of vague and changing requirements. This new lightweight methodology challenges many conventional tenets, including the long-held assumption that the cost of changing a piece of software necessarily rises dramatically over the course of time. XP recognizes that projects have to work to achieve this reduction in cost and exploit the savings once they have been earned. Fundamentals of XP include: Distinguishing between the decisions to be made by business interests and those to be made by project stakeholders. Writing unit tests before programming and keeping all of the tests running at all times. Integrating and testing the whole system-several times a day. Producing all software in pairs, two programmers at one screen. Starting projects with a simple design that constantly evolves to add needed flexibility and remove unneeded complexity. Putting a minimal system into production quickly and growing it in whatever directions prove most valuable. XP emphasizes not just testing, but testing well. Tests are automated. Tests are created before the code is written, while the code is written, and after the code is written. 2.4 Relationship between JUnit and Extreme Programming JUnit is one of the testing frameworks for Extreme Programming