Testdriven utveckling

January 8, 2018 | Author: Anonymous | Category: Engineering & Technology, Datavetenskap, Java Programming
Share Embed Donate


Short Description

Download Testdriven utveckling...

Description

Testdriven utveckling

Magnus Jonsson Siemens Medical Solutions

2

Soarian „ Stort projekt, ca 400 personer i projektet „ Distribuerad utveckling i USA, Indien och

Sverige „ Web baserat lösning med admin client „ Service orienterad arkitektur „ C++, MS SQL „ UI - Java script utan logik „ Admin client VB

2 ©2004 Siemens Medical Solutions Health Services Corporation.

3

3 Koncept

„ Agile med Scrum „ Continous integration „ Test Driven Utveckling „ Verktyg som stöd

3 ©2004 Siemens Medical Solutions Health Services Corporation.

4

Agile with Scrum „ Agile - lively, active och swift „ Scrum – vidare utveckling av

Iterativ/Incremental utveckling „ Scrum består av flera sprintar „ Arbetar i 30 dagars sprintar med ett ”fixed

scope” „ Små team 4 till 10 personer

4 ©2004 Siemens Medical Solutions Health Services Corporation.

5

Scrum Overview Överblick Daily Scrum Meetings

Sprint = 30 days Sprint Backlog

Product

Backlog Tasks

Product Backlog

5 ©2004 Siemens Medical Solutions Health Services Corporation.

6

Continous integration „ Integrerar koden ofta med ’all’ annan kod „ Bygger schemalagt (natt) och automatiskt vid incheckning

av ny körbar och testad kod „ Automatiska regressions tester - snabb feedback „ Genom röda tester kan man se kod-förändringar i andra

moduler snabbt Š Cruise control – trigggar Š Ant script – bygger

6 ©2004 Siemens Medical Solutions Health Services Corporation.

7

Continuous Integration „ Automatisk Kompilering och körning av test vid

kodförändring

Bygg och Integrations Server

Utvecklings miljö

Test Server

Utveckling test Server

9Involverade Unit Tests 9Involverade Service Tests 9Involverade Acceptans Tests

9Alla Unit Tests

Clear Case

9Alla ServiceTests 9Alla Acceptance Tests 9Alla UI Tests

9Involverade UI test 7 ©2004 Siemens Medical Solutions Health Services Corporation.

8

Test Driven Utveckling „ Test : Š styr utveckling Š Acceptans tester som specificerar en funktion inte validerar Š som design „ Specificerar och

implementerar unit tester innan man kodar „ Viktigt med ’Code reviews’

8 ©2004 Siemens Medical Solutions Health Services Corporation.

9

The testing model

Acceptance Test

Why Unit Tests? • They allow greater test coverage than functional tests. • They enable teamwork. • They prevent regression and limit the need for debugging. • They give us the courage to refactor. • They improve the implementation design. • They serve as the developer’s documentation. • They’re fun!

Stress & Load Test Functional Test Integration Test

Focus on each distinct unit of work

Unit Test

9 ©2004 Siemens Medical Solutions Health Services Corporation.

10

TDD och Continous integration

„ Vad är den verkliga fördelen av TDD? „ Test i focus „ Utvecklare tänker test när de utvecklar – mer kund focus „ Produkt analyster får större teknisk inblick Š Genom att delta i framtagandet av acceptance tester „ Ökar team känslan „ Bättre kvalitet

10 ©2004 Siemens Medical Solutions Health Services Corporation.

11

Fitnesse „ En Wiki – för att specificera test fall och data „ En Webbserver „ Ett enkelt test verktyg som Š Har stöd för att sätta upp test data Š Automatiskt jämför vad mjukvaran skall utföra och vad den faktiskt utför Š Har stöd för att ”rensa” test data efter sig „ Kopplar testfall med kod m.h.a. fixturer „ Finns för både java och C++ „ Ett forum för förståelse av funktionalitet

11 ©2004 Siemens Medical Solutions Health Services Corporation.

12

Exempel Test Driven Utveckling Allergy team „ Typer av test Š Unit tester – ren logic in Både SP och Service Š Stored Procedure – som helhet Š Service – som helhet Š Acceptance – säkerställa förväntad funktionalitet ƒ Service nivå och ner till DB lagret Š UI – Feature Integration Test (Manuella) – säkerställa förväntad funktionalitet

12 ©2004 Siemens Medical Solutions Health Services Corporation.

13

DD D

DAM Allergy team

T

- Utvecklings Sprint -

A D n increments

Acceptance test + Fixtur User stories

Design, Code & Unit test Automate User stories test

”DONE”!

Team effort Pair programming (optional)

13 ©2004 Siemens Medical Solutions Health Services Corporation.

14

Exempel Test Driven Utveckling Sprint 1

Sprint 2

„ User Stories– S1, S2

„ User Stories– S3

„ Acceptance test - S1, S2

„ Acceptance test - S3

„ Unit test och Kod –S1

„ Fixtur implementeras – S3

„ Fixtur implementeras -S1,

„ Unit test och Kod – S2

S2 „ FIT test skapas -S1, S2

„ FIT test skapas –S3 „ FIT test körs S2 funktioner

„ FIT test körs S1 funktioner

14 ©2004 Siemens Medical Solutions Health Services Corporation.

15

Arbetsflöde Usestory

„ User story – PA

„ Acceptance tester – PA eller Acceptance test

Testare

Acceptance test Walkthrough

„ Walkthrough av Acceptance

Implementera fixtur

„ Fixtur – Teknisk testare

tester – Alla involverade parter

Utveckling kan börja i nästa sprint 15 ©2004 Siemens Medical Solutions Health Services Corporation.

16

Länkar: „ TDD: „ http://www.agiledata.org/essays/tdd.html „ http://en.wikipedia.org/wiki/Test_driven_development „ http://www.testdriven.com „ Tools: „ Fitnesse: http://www.fitnesse.org „ J-Unit, Cpp Test tools, SQL-Unit, DB-Unit

16 ©2004 Siemens Medical Solutions Health Services Corporation.

17

Q&A

17 ©2004 Siemens Medical Solutions Health Services Corporation.

View more...

Comments

Copyright � 2017 NANOPDF Inc.
SUPPORT NANOPDF