< prev

01 / 25

next >

Diplomarbeit



Component-Based Testing:

Towards Continuous Integration in Software Engineering


Andreas Schildbach



Aufgabensteller: Prof. Bernd Brügge, Ph.D.

Betreuer: Dipl.-Inf. Univ. Oliver Creighton

Abgabedatum: 2001-11-15


< prev

02 / 25

next >

Talk Outline
  1. > Process Pattern Catalogue <
  2. Component Anatomy
  3. Testbench Usage
  4. Implementation Details

< prev

03 / 25

next >

pattern relationships: component based testing

< prev

04 / 25

next >

pattern relationships: uniform project name

Uniform Project Name
  • define an uniform name for every project

< prev

05 / 25

next >

pattern relationships: project structure and version control

Project Structure and Version Control
  • establish a single source point [fow, Bec00]

< prev

06 / 25

next >

pattern relationships: automated integration

Automated Integration
  • automate the process of integration (e.g. Ant [jak01])

< prev

07 / 25

next >

pattern relationships: continuous integration cycle

Continuous Integration
  • assign control of the integration process to one single instance

< prev

08 / 25

next >

pattern relationships: design by contract

Design by Contract [Mey92]
  • component contracts that have to be observed

< prev

09 / 25

next >

pattern relationships: component based testing

Component Based Testing
  • add automation to the component tests
  • test harness: Testbench!

< prev

10 / 25

next >

Talk Outline
  1. Process Pattern Catalogue
  2. > Component Anatomy <
  3. Testbench Usage
  4. Implementation Details

< prev

11 / 25

next >

the anatomy of a component

Figure: The Anatomy of a Component


< prev

12 / 25

next >

inner and outer interfaces

Figure: Inner and Outer Interfaces


< prev

13 / 25

next >

the extension to the component anatomy

Figure: The Extension to the Component Anatomy


< prev

14 / 25

next >

Talk Outline
  1. Process Pattern Catalogue
  2. Component Anatomy
  3. > Testbench Usage <
  4. Implementation Details

< prev

15 / 25

next >

Writing a Model Specification


<contract name="demo">

    <component name="A" class="testbench.test.A" runtime="bean">

        <property type="string" name="name"/>

        <associationend
            association="ab"
            target="B"
            multiplicity="n"/>

        <method name="do_something">
            <constraint property="name" type="post" language="regexp">
                [a-zA-Z0-9]*
            </constraint>
        </method>

    </component>

    <component name="B" class="testbench.test.B" runtime="bean">

        <associationend
            association="ab"
            target="A"
            multiplicity="1"/>

    </component>

</contract>

			

< prev

16 / 25

next >

Writing a Test Case Specification

Ant tasks:
  • tContract load model specification
  • tCreate create instance of a component, returns reference
  • tDestroy destroys instance
  • tLink link two components, returns association
  • tUnlink break an association
  • tGet get value from component property
  • tSet set value of a component property
  • tCall calls business method, constraint checking applied
  • tInvariant manual constraint checking

< prev

17 / 25

next >

sample sequence

< prev

18 / 25

next >

sample sequence

< prev

19 / 25

next >


<target name="test">
	<tContract file="src/tests/depot-contract.xml"/>
	<tCreate ref="a" component="A"/>
	<tCreate ref="b" component="B"/>
	<tLink id="ab" association="ab" ref1="a" ref2="b"/>
	<tSet ref="a" property="name" value="fido"/>
	<tCall ref="a" method="do_something"/>
	<tGet ref="a" property="name"/>
	<tUnlink id="ab"/>
	<tDestroy ref="a"/>
	<tDestroy ref="b"/>
</target>

			

< prev

20 / 25

next >

Talk Outline
  1. Process Pattern Catalogue
  2. Component Anatomy
  3. Testbench Usage
  4. > Implementation Details <

< prev

21 / 25

next >

decomposition into subsystems

Figure: Decomposition into Subsystems


< prev

22 / 25

next >

the language subsystem

Figure: The Language Subsystem


< prev

23 / 25

next >

usage of the command pattern in the action subsystem

Figure: Usage of the Command Pattern in the Action Subsystem


< prev

24 / 25

next >

Future

  • more constraint languages
  • more runtimes (EJB, .NET components, ...)
  • alternative way to write test plans (editor?)
  • standalone OCL interpreter

< prev

25 / 25

next >

Bibliography

  1. [Bec00] Kent Beck. Extreme Programming Explained. Embrace Change. Addison Wesley, 2000.
  2. [jak01] Apache Software Foundation. The Jakarta Project - Ant http://jakarta.apache.org/ant/, 2001.
  3. [fow] Continuous Integration http://www.martinfowler.com/articles/continuousIntegration.html
  4. [Mey92] Bertrant Meyer. Eiffel: The Language. Prentice Hall, 1992.
  5. [Mey97] Bertrant Meyer. Object-Oriented Software Construction. Prentice Hall PTR, 1997.


< prev

a01

next >

APPENDIX


< prev

a02

next >

use case diagram (automated integration applied)

Figure: Use Case Diagram (Automated Integration applied)


< prev

a03

next >

use case diagram (continuous integration applied)

Figure: Use Case Diagram (Continuous Integration applied)


< prev

a04

next >

the analysis model

Figure: The Analysis Model


< prev

a05

next >

the class model of the model subsystem

Figure: The Class Model of the Model Subsystem


< prev

a06

next >


<?xml version="1.0" ?>

<project name="thesis" basedir="." default="compile">

    <target name="all" depends="clean,compile,test,javadoc,tex"/>

    <target name="clean">
        <delete dir="build"/>
    </target>

    <target name="prepare">
        <mkdir dir="build/classes"/>
        <mkdir dir="build/tex"/>
        <mkdir dir="build/doc"/>
    </target>

    <target name="compile" depends="prepare">
        <javac
            srcdir="src/classes"
            destdir="build/classes"
            includes="**/*.java"
            debug="on"
            optimize="off"
        >
            <classpath><fileset dir="src/lib"/></classpath>
        </javac>
    </target>

    <target name="javadoc" depends="prepare">
        <javadoc
            sourcepath="src/classes"
            destdir="build/doc"
            packagenames="thesis.*,tudresden.*"
            version="true"
            author="true"
        >
            <classpath><fileset dir="src/lib"/></classpath>
        </javadoc>
    </target>

    [...]

    <target name="taskdef">
        <taskdef file="src/etc/ant-taskdefs.properties" classpath="build/classes"/>
    </target>

    <target name="test" depends="taskdef">
        <tContract file="src/tests/depot-contract.xml"/>
        <tCreate ref="a" component="A"/>
        <tCreate ref="b" component="B"/>
        <tSet ref="a" property="name" value="fido"/>
        <tLink id="ab" association="ab" ref1="a" ref2="b"/>
        <tCall ref="a" method="lookUpName"/>
        <tGet ref="a" property="name"/>
        <tUnlink id="ab"/>
        <tDestroy ref="a"/>
        <tDestroy ref="b"/>
    </target>

</project>