Comparative Development Methodologies
-
Upload
elliando-dias -
Category
Technology
-
view
1.114 -
download
0
description
Transcript of Comparative Development Methodologies
![Page 1: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/1.jpg)
Comparative Development Methodologies
Lecture 7
XP (Tools)
For the BSc IS&M Programme
Dell ZhangBirkbeck, University of London
![Page 2: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/2.jpg)
From Teach Yourself Extreme Programming In 24 Hours.
![Page 3: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/3.jpg)
Something New
Version Control Subversion (http://subversion.tigris.org/)
TortoiseSVN (http://tortoisesvn.tigris.org/) Git (http://git.or.cz/)
Testing xUnit, e.g., JUnit (http://www.junit.org/): client Cactus (http://jakarta.apache.org/cactus/): server
![Page 4: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/4.jpg)
Something New
Automated Build & Project Management Apache Ant (http://ant.apache.org/) Apache Maven (http://maven.apache.org/)
Bug-Tracking & Project Management Trac (http://trac.edgewall.org/)
![Page 5: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/5.jpg)
Something New
Code Generation XDoclet (http://xdoclet.sourceforge.net/)
Collaboration Wiki (http://en.wikipedia.org/wiki/Wiki)
Development Environment Eclipse (http://www.eclipse.org/ ) jEdit (http://www.jedit.org/)
![Page 6: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/6.jpg)
Version Control
Do you work in a team? Has it ever happened that you were working on a file,
and someone else was working on the same file at the same time? Did you lose your changes to that file because of that?
Have you ever saved a file, and then wanted to revert the changes you made? Have you ever wished you could see what a file looked like some time ago?
Have you ever found a bug in your project and wanted to know when that bug got into your files?
![Page 7: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/7.jpg)
Version Control
![Page 8: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/8.jpg)
![Page 9: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/9.jpg)
![Page 10: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/10.jpg)
![Page 11: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/11.jpg)
![Page 12: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/12.jpg)
![Page 13: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/13.jpg)
![Page 14: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/14.jpg)
Features Directory versioning Atomic commits Versioned metadata Choice of network layers Consistent data handling Efficient branching and tagging Hackability
![Page 15: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/15.jpg)
![Page 16: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/16.jpg)
![Page 17: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/17.jpg)
![Page 18: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/18.jpg)
xUnit
The xUnit testing framework is a simple, easy-to-use unit testing tool.
There are many versions of the framework, depending on language. JUnit for Java, CppUnit for C++ PyUnit for Python VBUnit for Visual Basic ……
![Page 19: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/19.jpg)
Recall: Test Driven Development If it's worth building, it's worth testing.
TDD lifecycle
![Page 20: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/20.jpg)
JUnit
Architecture
![Page 21: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/21.jpg)
JUnit
Packages import org.junit.Test import static org.junit.Assert.* ……
![Page 22: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/22.jpg)
JUnit
Simple Test Case Annotate a method with @Test Check values with assertions
assertEquals assertTrue; assertFalse assertSame; assertNotSame assertNull; assertNotNull fail; …
http://junit.sourceforge.net/javadoc/junit/framework/Assert.html
![Page 23: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/23.jpg)
![Page 24: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/24.jpg)
JUnit
Fixture Tests need to run against the background of a
known set of objects which is called a test fixture. Often, you will be able to use the same fixture for
several different tests. Each case will send slightly different messages or
parameters to the fixture and will check for different results.
![Page 25: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/25.jpg)
JUnit
Initialization/Releasing for Common Fixture Run before and after each test
@Before @After
Run before and after all tests @BeforeClass @AfterClass
![Page 26: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/26.jpg)
JUnit
New Testing Methods in JUnit4 Test for exceptions
@Test(expected = Exception.class) Test for performance
@Test(timeout = 500)
![Page 27: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/27.jpg)
![Page 28: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/28.jpg)
JUnit
Test Runners The test runner will use reflection to ascertain test
names at runtime, and then execute your tests. JUnit4 only comes with a textual TestRunner.
org.junit.runner.TextListener.run(TestClass1.class, ...); For graphical interface,
Use an IDE that supports JUnit4.
![Page 29: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/29.jpg)
JUnit Plugin for Eclipse
![Page 30: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/30.jpg)
JUnit
Failure vs. Errors Failures are anticipated and checked for with
assertions. Errors are unanticipated problems.
![Page 31: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/31.jpg)
Ant
Ant is an automated build tool Java-based Open Source An Apache project Driven by an XML format build file Like make, but without make's wrinkles Comes with Eclipse
![Page 32: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/32.jpg)
Ant
Build Process Get latest source code Clean target folders Create new target folders Compile and link source Run unit tests Deploy to staging
![Page 33: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/33.jpg)
Ant
Build File – Layout
![Page 34: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/34.jpg)
Ant
Build File – Tags Project
The top-level tag in the build file that describes the project itself.
Target A target defines a collection of Ant tasks. A target can depend on other targets. A target also has the capability to perform its execution if
(or unless) a property has been set.
![Page 35: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/35.jpg)
Ant
Build File – Tags Task
A task is a piece of code that can be executed. A task can have multiple attributes or arguments.
The value of an attribute might contain references to a property.
These references will be resolved before the task is executed.
There is a set of built-in tasks, along with a number of optional tasks; it's also very easy to write your own.
![Page 36: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/36.jpg)
Ant
Build File – Tags Task (
http://ant.apache.org/manual/tasksoverview.html) Archive; Audit/Coverage; Compile; Deployment;
Documentation; EJB; Execution; File; Java2 Extensions; Logging; Mail; Miscellaneous; .NET; Pre-process; Property; Remote; SCM; Testing; Visual Age for Java …
![Page 37: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/37.jpg)
Ant
Build File – Tags Property
A project can have a set of properties. A property has a name and a value. Properties can be used in the value of tag attributes.
This is done by placing the property name between "${" and "}" in the attribute value, e.g. ${builddir}.
In addition to properties defined in the build file, Ant also provides access to all system properties and some built-in properties.
![Page 38: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/38.jpg)
Ant
Build File – Example
![Page 39: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/39.jpg)
Ant
![Page 40: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/40.jpg)
Ant
Integrating Unit Tests and Build Setting up the Test Data with Ant
Ant can be used to directly execute SQL commands onto any database that supports ODBC (via JDBC).
Running JUnit Tests from Ant Using Ant to Email Test Reports
![Page 41: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/41.jpg)
![Page 42: Comparative Development Methodologies](https://reader033.fdocuments.in/reader033/viewer/2022061201/547a5c28b37959892b8b4991/html5/thumbnails/42.jpg)
Take Home Messages
Subversion Version Control Tool http://subversion.tigris.org/
JUnit Unit Testing Tool http://www.junit.org/
Ant Automated Build Tool (and Much More) http://ant.apache.org/