Software Engineering and Architecture

Slides:



Advertisements
Similar presentations
TDD patterns and *DD. General Patterns Isolated Test Should the running of the tests affect one another? Test List What should you test? Test First When.
Advertisements

Extreme Programming Alexander Kanavin Lappeenranta University of Technology.
Alternate Software Development Methodologies
NAUG NAUG Knowledge Evening – th February 2007.
EXtreme.NET Dr. Neil Roodyn. eXtreme.NET Who is Dr. Neil? MISSION: To increase the value of your Software Business Working with software for way too long.
Computer Engineering 203 R Smith Agile Development 1/ Agile Methods What are Agile Methods? – Extreme Programming is the best known example – SCRUM.
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 1: Software and Software Engineering.
Test-Driven Development Eduard Miric ă. The problem.
Henrik Bærbak Christensen1 Frameworks / Product Lines The frame for reuse.
The HotCiv GUI Instantiating the MiniDraw Framework.
Test Stubs... getting the world under control. TDD of State Pattern To implement GammaTown requirements I CS, AUHenrik Bærbak Christensen2.
Henrik Bærbak Christensen1 Test Driven Development “TDD” Summary.
Henrik Bærbak Christensen1 Build Management Clean environment that works...
Henrik Bærbak Christensen1 Test Driven Development “TDD” A process focusing on reliability, progress, and confidence.
HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments.
Deriving State…...and an example of combining behaviour.
Multi Dimensional Variance: How to make ultra flexible software!
Mandatory 1 / AlphaCiv … Traps to be aware of …. Warn or not? I once asked Kent Beck the following –I have a lot of students in a course in design patterns.
Applying the Principles Two Examples. Example 1 New Requirement It would be nice with a simple GUI “to see something” instead of just xUnit tests...
Refactoring and Integration Testing or Strategy, introduced reliably by TDD The power of automated tests.
MiniDraw Introducing a Framework... and a few patterns.
Test Driven Development Introduction Issued date: 8/29/2007 Author: Nguyen Phuc Hai.
Mandatory 1 / AlphaCiv … a few comments…. Overall: Generally – good work – good effort Seems you are generally doing TDD Minor hick-ups –”My own way is.
Software Architecture Quality Attributes. Good or Bad? Measurable criterions required...
CS223: Software Engineering Lecture 18: The XP. Recap Introduction to Agile Methodology Customer centric approach Issues of Agile methodology Where to.
Software Engineering Lecture 11 Software Testing Presenter: Josef Hallberg 1.
Coming up: What is Agile? XP Development Dan Fleck 2010 Dan Fleck 2010.
AGILE METHODS Curtis Cook CS 569 Spring 2003.
Embedded Systems Software Engineering
CS223: Software Engineering
Agile Methods SENG 301.
Instantiating the MiniDraw Framework
Introducing a Framework ... and a few patterns
Test-driven development
Software Architecture in Practice
Applying the Principles
Test Driven Development 1 November Agenda  What is TDD ?  Steps to start  Refactoring  TDD terminology  Benefits  JUnit  Mocktio  Continuous.
HotCiv Project Starting up!.
Mandatory 1 / AlphaCiv … Traps to be aware of ….
Test-Driven Development
Project Management and the Agile Manifesto
Johanna Rothman Create Technical Excellence Chapter 9
What do you need to know about XP?
How to Successfully Implement an Agile Project
Test-driven development (TDD)
Sharing the good, the bad, the ugly & What can we do about it?
Chapter 3 – Agile Software Development
Introduction to Agile Blue Ocean Workshops.
Objects First with Java A Practical Introduction using BlueJ
Coming up: What is Agile?
Refactoring.
Agile Development – a new way of software development?
Extreme Programming.
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Extreme Programming (and Pair Programming)
Software Engineering and Architecture
Software Engineering and Architecture
Chapter 1: Software and Software Engineering
Presentation transcript:

Software Engineering and Architecture Test-Driven Development

Henrik Bærbak Christensen What is it? Test-Driven Development It is a systematic programming technique Focus on Continued Speed Reliability It is not a testing technique, despite the name Tests are means, not an end in itself But they are sooo nice to have… CS@AU Henrik Bærbak Christensen

Systematic Programming TDD replaces tacit knowledge with a formulated process The mantra Clean code that works The values The four values that abstractly define what we want The rhythm The five steps in each highly focused and fast-paced iteration. Testing principles The testing principles that defines a term for a specific action to make in each step Form: Name - Problem – Solution CS@AU Henrik Bærbak Christensen

Henrik Bærbak Christensen The Mantra To ensure that our software is reliable all the time “Clean code that works” To ensure fast development progress To ensure that we dare restructure our software and its architecture Clean = understandable and changeable Clean code that works CS@AU Henrik Bærbak Christensen

Henrik Bærbak Christensen The Values Keep focus Make one thing only, at a time! Often Fixing this, requires fixing that, hey this could be smarter, fixing it, ohh – I could move that to a library, hum hum, … Take small steps Taking small steps allow you to backtrack easily when the ground becomes slippery I can do it by introducing these two classes, hum hum, no no, I need a third, wait… CS@AU Henrik Bærbak Christensen

Henrik Bærbak Christensen The Values Speed You are what you do! Deliver every 14 days!!! Often After two years, half the system is delivered, but works quite in another way than the user anticipate/wants… Speed, not by being sloppy but by making less functionality of superior quality! Simplicity Maximize the amount of work not done! I can make a wonderful recursive solution parameterized for situations X, Y and Z (that will never ever occur in practice) CS@AU Henrik Bærbak Christensen

The Iteration Skeleton Each TDD iteration follows the Rhythm (6. All tests pass again after refactoring!) CS@AU Henrik Bærbak Christensen

The Rhythm: Red-Green-Refactor Improve code quality Works part Clean part Implement delta-feature that does not break any existing code Introduce test of delta-feature Time CS@AU Henrik Bærbak Christensen

The Three Starter Principles CS@AU Henrik Bærbak Christensen

Enough… Learning by Doing…

You are all employed today Welcome to PayStation Ltd. We will develop the main software to run pay stations. [Demo] Henrik Bærbak Christensen 11

Henrik Bærbak Christensen Case: Pay Station Welcome to PayStation Ltd. Customer: AlphaTown Requirements accept coins for payment 5, 10, 25 cents show time bought on display print parking time receipts US: 2 minutes cost 5 cent handle buy and cancel Henrik Bærbak Christensen

Henrik Bærbak Christensen Stories Henrik Bærbak Christensen

Henrik Bærbak Christensen Design: Static View For our purpose the design is given… Central interface PayStation Henrik Bærbak Christensen

Henrik Bærbak Christensen My Testlist From the book CS@AU Henrik Bærbak Christensen

Henrik Bærbak Christensen And on… CS@AU Henrik Bærbak Christensen

Central Principles Overview

Henrik Bærbak Christensen Refactoring Fix your broken windows Clean up now or your code will deteriorate quickly! CS@AU Henrik Bærbak Christensen

Henrik Bærbak Christensen CS@AU Henrik Bærbak Christensen

Henrik Bærbak Christensen CS@AU Henrik Bærbak Christensen

Henrik Bærbak Christensen CS@AU Henrik Bærbak Christensen

Tests as Specifications Outlook Tests as Specifications

Henrik Bærbak Christensen Insight An early insight was that the tests are actually a specification of the requested behaviour Aka a requirements specification! What if costumers could write them themselves !?!? Gave rise to much experimentation Behaviour-Driven development CS@AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Spock A lot of frameworks were developed Many are... Well... IMO somewhat cumbersome to use Spock I find is pretty easy to get going, though Only problem, you code in groovy, not Java... CS@AU Henrik Bærbak Christensen