Agile Development Infrastructure

25
Agile Development Agile Development Infrastructure Infrastructure MUUG – June 13, 2006 MUUG – June 13, 2006 Steve Moffat Steve Moffat

description

Agile Development Infrastructure. MUUG – June 13, 2006. Steve Moffat. Agile Development. Iterations of 3 – 4 weeks. Emphasize real time communication. Measured by working software. Sometimes criticized as undisciplined. Agile Development. - PowerPoint PPT Presentation

Transcript of Agile Development Infrastructure

Agile Development Agile Development InfrastructureInfrastructure

MUUG – June 13, 2006MUUG – June 13, 2006

Steve MoffatSteve Moffat

• Iterations of 3 – 4 weeksIterations of 3 – 4 weeks

Agile DevelopmentAgile Development

• Emphasize real time Emphasize real time communicationcommunication • Measured by working Measured by working

softwaresoftware • Sometimes criticized as Sometimes criticized as undisciplinedundisciplined

smoffat
Most agile methods attempt to minimize risk by developing software in short timeboxes, called iterations, which typically last one to four weeks. Each iteration is like a miniature software project of its own, and includes all of the tasks necessary to release the mini-increment of new functionality: planning, requirements analysis, design, coding, testing, and documentation. While an iteration may not add enough functionality to warrant releasing the product, an agile software project intends to be capable of releasing new software at the end of every iteration. At the end of each iteration, the team reevaluates project priorities.

Agile methods are adaptive rather than predictive.Agile methods are adaptive rather than predictive. Engineering Engineering methods tend to try to plan out a large part of the software methods tend to try to plan out a large part of the software

process in great detail for a long span of time, this works well process in great detail for a long span of time, this works well until things change. So their nature is to resist change. The agile until things change. So their nature is to resist change. The agile methods, however, methods, however, welcome changewelcome change. They try to be processes . They try to be processes that adapt and thrive on change, even to the point of changing that adapt and thrive on change, even to the point of changing

themselves.themselves.

Agile methods are people-oriented rather than process-oriented.Agile methods are people-oriented rather than process-oriented. The goal of engineering methods is to define a process that will The goal of engineering methods is to define a process that will work well whoever happens to be using it. Agile methods assert work well whoever happens to be using it. Agile methods assert that no process will ever make up the skill of the development that no process will ever make up the skill of the development team, so the role of a process is to team, so the role of a process is to support the development support the development

teamteam in their work. in their work.

Martin FowlerMartin Fowler

Agile DevelopmentAgile Development

Productivity of the Productivity of the development team is development team is

keykey

Agile DevelopmentAgile Development

http://agilemanifesto.org/http://agilemanifesto.org/

The Cycle, or IterationThe Cycle, or Iteration

Support PlatformsSupport Platforms

The piecesThe pieces

DevelopmentDevelopmentWorkstationsWorkstations

•EclipseEclipse

•TomcatTomcat

•WindowsWindows

•LinuxLinux

Eclipse and TomcatEclipse and Tomcat

DevelopDevelopCompileCompile

Unit TestUnit TestArchiveArchive

JavaDoc…JavaDoc…/**/**

* Returns an Image object that can then be painted on the screen. * Returns an Image object that can then be painted on the screen.

* The url argument must specify an absolute * The url argument must specify an absolute {@link URL}. The name . The name

* argument is a specifier that is relative to the url argument.* argument is a specifier that is relative to the url argument.

* <p>* <p>

* This method always returns immediately, whether or not the* This method always returns immediately, whether or not the

* image exists. When this applet attempts to draw the image on* image exists. When this applet attempts to draw the image on

* the screen, the data will be loaded. The graphics primitives* the screen, the data will be loaded. The graphics primitives

* that draw the image will incrementally paint on the screen.* that draw the image will incrementally paint on the screen.

**

* * @param url an absolute URL giving the base location of the image url an absolute URL giving the base location of the image

* @param name the location of the image, relative to the url argument* @param name the location of the image, relative to the url argument

* @return the image at the specified URL* @return the image at the specified URL

* @see Image* @see Image

*/ */

public Image getImage(URL url, String name) { public Image getImage(URL url, String name) {

try { try {

return getImage(new URL(url, name));return getImage(new URL(url, name));

} catch (MalformedURLException e) {} catch (MalformedURLException e) {

return null;return null;

} }

} }

……turns intoturns into

getImagegetImage

public Image public Image getImagegetImage(URL url,(URL url, String name) String name)

Returns an Image object that can then be painted on Returns an Image object that can then be painted on the screen. The url argument must specify an absolute the screen. The url argument must specify an absolute URL. The name argument is a specifier that is relative to URL. The name argument is a specifier that is relative to the url argument. the url argument.

This method always returns immediately, whether or not This method always returns immediately, whether or not the image exists. When this applet attempts to draw the the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The image on the screen, the data will be loaded. The graphics primitives that draw the image will graphics primitives that draw the image will incrementally paint on the screen.incrementally paint on the screen.

Parameters:Parameters:url - an absolute URL giving the base location of url - an absolute URL giving the base location of

the image the image name - the location of the image, relative to the name - the location of the image, relative to the

url argument url argument Returns:Returns:

the image at the specified URL the image at the specified URL See Also:See Also:

ImageImage

JUnitJUnit

• JUnit tests allow you to write code faster while increasing JUnit tests allow you to write code faster while increasing quality.quality.

• JUnit tests check their own results and provide immediate JUnit tests check their own results and provide immediate feedback.feedback.

• JUnit – is a program to test a programJUnit – is a program to test a program

• Easily integrated into new or existing java classesEasily integrated into new or existing java classes

smoffat
* JUnit tests allow you to write code faster while increasing quality. Yeah, I know, it sounds counter-intuitive, but it's true! When you write tests using JUnit, you'll spend less time debugging, and you'll have confidence that changes to your code actually work. This confidence allows you to get more aggressive about refactoring code and adding new features. Without tests, it's easy to become paranoid about refactoring or adding new features because you don't know what might break as a result. With a comprehensive test suite, you can quickly run the tests after changing the code and gain confidence that your changes didn't break anything. If a bug is detected while running tests, the source code is fresh in your mind, so the bug is easily found. Tests written in JUnit help you write code at an extreme pace and spot defects quickly. * JUnit is elegantly simple. Writing tests should be simple - that's the point! If writing tests is too complex or takes too much time, there's no incentive to start writing tests in the first place. With JUnit, you can quickly write tests that exercise your code and incrementally add tests as the software grows. Once you've written some tests, you want to run them quickly and frequently without disrupting the creative design and development process. With JUnit, running tests is as easy and fast as running a compiler on your code. In fact, you should run your tests every time you run the compiler. The compiler tests the syntax of the code and the tests validate the integrity of the code. * JUnit tests check their own results and provide immediate feedback. Testing is no fun if you have to manually compare the expected and actual result of tests, and it slows you down. JUnit tests can be run automatically and they check their own results. When you run tests, you get simple and immediate visual feedback as to whether the tests passed or failed. There's no need to manually comb through a report of test results. * JUnit tests can be composed into a hierarchy of test suites. JUnit tests can be organized into test suites containing test cases and even other test suites. The composite behavior of JUnit tests allows you to assemble collections of tests and automatically regression test the entire test suite in one fell swoop. You can also run the tests for any layer within the test suite hierarchy. * Writing JUnit tests is inexpensive. Using the JUnit testing framework, you can write tests cheaply and enjoy the convenience offered by the testing framework. Writing a test is as simple as writing a method that exercises the code to be tested and defining the expected result. The framework provides the context for running the test automatically and as part of a collection of other tests. This small investment in testing will continue to pay you back in time and quality. * JUnit tests increase the stability of software. The fewer tests you write, the less stable your code becomes. Tests validate the stability of the software and instill confidence that changes haven't caused a ripple-effect through the software. The tests form the glue of the structural integrity of the software. * JUnit tests are developer tests. JUnit tests are highly localized tests written to improve a developer's productivity and code quality. Unlike functional tests, which treat the system as a black box and ensure that the software works as a whole, unit tests are written to test the fundamental building blocks of the system from the inside out. Developer's write and own the JUnit tests. When a development iteration is complete, the tests are promoted as part and parcel of the delivered product as a way of communicating, "Here's my deliverable and the tests which validate it." * JUnit tests are written in Java. Testing Java software using Java tests forms a seamless bond between the test and the code under test. The tests become an extension to the overall software and code can be refactored from the tests into the software under test. The Java compiler helps the testing process by performing static syntax checking of the unit tests and ensuring that the software interface contracts are being obeyed. * JUnit is free!

JUnitJUnit

public class HelloWorld extends TestCase public class HelloWorld extends TestCase

{ {

public void testMultiplication() public void testMultiplication()

{ // Testing if 2*2=4: { // Testing if 2*2=4:

assertEquals ("Multiplication", 4, 2*2); assertEquals ("Multiplication", 4, 2*2);

} }

} }

A simple exampleA simple example

JUnitJUnit@Test(expected= IndexOutOfBoundsException.class) public void @Test(expected= IndexOutOfBoundsException.class) public void empty() {      empty() {     

new ArrayList<Object>().get(0);  new ArrayList<Object>().get(0); 

} }

Another simple exampleAnother simple example

Many developers Many developers archivearchive

CVSCVSCo

mm

it

Com

mit

code

code

Com

mit

C

om

mit

co

de

code

Commit Commit codecode

Commit Commit codecode

Commit

Commit codecode

CruiseControlCruiseControl

• Build Automation Build Automation

• Supports multiple projectsSupports multiple projects

• Continuous Continuous Integration Integration

• Web Interface for status and controlWeb Interface for status and control

• Status Email Status Email

smoffat
An important part of any software development process is getting reliable builds of the software. Despite it's importance, we are often surprised when this isn't done. We stress a fully automated and reproducible build, including testing, that runs many times a day. This allows each developer to integrate daily thus reducing integration problems.

CoberturaCobertura

• Calculates the percentage of code accessed by JUnit testsCalculates the percentage of code accessed by JUnit tests

• Based on jcoverageBased on jcoverage• Works by inserting instrumentation instructions into compiled Works by inserting instrumentation instructions into compiled codecode

• Records which lines of code have been testedRecords which lines of code have been tested

• Calculates complexity valueCalculates complexity value

• Produces output in html or xmlProduces output in html or xml

smoffat
cloverjcoverageemma

Build ServerBuild Server

CVS ExportCVS ExportCompileCompile

JUnit testJUnit testCVS TagCVS Tag

InstrumentInstrument

Java DocJava DocPackagePackage

DevelopmentDevelopmentServerServer• CVS / CVSWebCVS / CVSWeb

• AntAnt

• CoberturaCobertura

• VQWikiVQWiki

• BugzillaBugzilla

• HP-UXHP-UX

• Oracle Java Application ServerOracle Java Application Server

RuntimeRuntime• HP-UXHP-UX

• LinuxLinux

• Oracle Application ServerOracle Application Server

• Oracle Database ServerOracle Database Server

Support PlatformsSupport Platforms

The piecesThe pieces• Apache Ant: Apache Ant: http://ant.apache.org

• Apache Tomcat: Apache Tomcat: http://tomcat.apache.org

• Apache WebServer: Apache WebServer: http://httpd.apache.org

• Bugzilla: Bugzilla: http://www.bugzilla.org

• Cobertura: http://junit.sourceforge.netCobertura: http://junit.sourceforge.net

• CruiseControl: http://cruisecontrol.sourceforge.net/CruiseControl: http://cruisecontrol.sourceforge.net/

• CVS: CVS: http://ximbiot.com/cvs/wiki/index.php?title=Main_Page

• CVSWeb: CVSWeb: http://www.freebsd.org/projects/cvsweb.html

• Eclipse: Eclipse: http://www.eclipse.org

• Java: Java: http://java.sun.com

• JUnit: JUnit: http://junit.sourceforge.net

• VQWiki: VQWiki: http://www.vqwiki.org

• Linux: redhat, fedora, ubuntuLinux: redhat, fedora, ubuntu

More pieces.. Not so More pieces.. Not so freefree• HP-UX: HP-UX: http://www.hp.com or or

http://h20338.www2.hp.com/hpux11i/cache/324545-0-0-0-121.html

• Oracle Application Server: Oracle Application Server: http://www.oracle.com (middleware) or(middleware) or

http://www.oracle.com/appserver/index.html

• Oracle Database Server: Oracle Database Server: http://www.oracle.com (database) (database) oror

http://www.oracle.com/database/index.html

• Rational Tools: RequisitePro, TestManager, Robot: Rational Tools: RequisitePro, TestManager, Robot:

http://www-306.ibm.com/software/awdtools/suite/index.html

• Windows: desktop, serverWindows: desktop, server

Even more pieces…Even more pieces…

• Password Manager: Password Manager: http://www.geocities.com/ramix_info/passwordmanager.ht%6dl

• Cronolog: Cronolog: http://cronolog.org

• CGI Scripts for deploy automationCGI Scripts for deploy automation

The Future…The Future…• Bugzilla to Jira $$Bugzilla to Jira $$

• CVS to SubversionCVS to Subversion

• Ant to MavenAnt to Maven

• XPlannerXPlanner

• Upgrades upgrades upgrades…Upgrades upgrades upgrades…