Test-driven development does it really ensure quality? Trial lecture

Similar documents
Evaluating the Efficacy of Test-Driven Development: Industrial Case Studies

Test-Driven Development. SC12 Educator s Session November 13, 2012

Evaluating the Efficacy of Test-Driven Development: Industrial Case Studies

Making Architectural Design Phase Obsolete TDD as a Design Method

Learning and Coaching Agile Methods. Görel Hedin Computer Science Lund University, Sweden

Some Research on Agile Software Development

Comparing Agile Software Processes Based on the Software Development Project Requirements

XP and TDD. Extreme Programming and Test Driven Development. Bertrand Meyer, Manuel Oriol Andreas Leitner. Chair of Software Engineering ETH Zurich

Test Driven Development Part III: Continuous Integration Venkat Subramaniam

Software Architecture Improvement through Test-Driven Development

Introduction to extreme Programming (XP)

Test-Driven Automation: Adopting Test-First Development to Improve Automation Systems Engineering Processes

Software Quality and Agile Methods

Agile Software Development Methodologies and Its Quality Assurance

Realizing quality improvement through test driven development: results and experiences of four industrial teams

Introduction to Agile Software Development Process. Software Development Life Cycles

A Survey of Evidence for Test Driven Development in Academia

V. Phani Krishna et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 2 (6), 2011,

An Introduction to Agile Engineering Practices

The Role of CM in Agile Development of Safety-Critical Software

Agile Development and Testing Practices highlighted by the case studies as being particularly valuable from a software quality perspective

Introduction to Software Testing

Iteration Planning. also called Iteration Kickoff

Automated Acceptance Testing of High Capacity Network Gateway

Benefits of Test Automation for Agile Testing

Test-Driven Development

QUALITY ASSURANCE IN EXTREME PROGRAMMING Plamen Balkanski

The Impact of Test-Driven Development on Software Development Productivity An Empirical Study

Advanced Test-Driven Development

ASSURING SOFTWARE QUALITY USING VISUAL STUDIO 2010

A Comparison of Software Cost, Duration, and Quality for Waterfall vs. Iterative and Incremental Development: A Systematic Review

Continuous Integration, Delivery and Deployment. Eero Laukkanen T Software Testing and Quality Assurance P

Investigation of Adherence Degree of Agile Requirements Engineering Practices in Non-Agile Software Development Organizations

Agile Techniques for Object Databases

ICAgile Learning Roadmap Agile Testing Track

Extreme Programming. Sergey Konovalov and Stefan Misslinger. May 23, 2006

Agile Testing (October 2011) Page 1. Learning Objectives for Agile Testing

Alternative Development Methodologies

Design of Acceptance Test Process through Comparative Analysis of the Test Automation Technique

Job Satisfaction and Motivation in a Large Agile Team

CSE 4415 / SWE 5415 Software Testing 2 Fall 2004 Olin Engineering Building, Room 128 Credits: 3.00

Co-Presented by Mr. Bill Rinko-Gay and Dr. Constantin Stanca 9/28/2011

Deep Agile Blending Scrum and Extreme Programming. Jeff Sutherland Ron Jeffries

Agile Testing and Extreme Programming

An Initial Investigation of Test Driven Development in Industry

Story Card Based Agile Software Development

Agile Software Engineering, a proposed extension for in-house software development

Agile Testing Overview

Workshop on Agile Test Strategies and Experiences. Fran O'Hara, Insight Test Services, Ireland

Test Driven Development Method in Software Development Process

Accelerating Time to Market with Agile Testing

Software developers are known for adopting new technologies and practices on the

Software Development Methodologies

Agile Software Engineering Practice to Improve Project Success

Basic Trends of Modern Software Development

An Overview of Quality Assurance Practices in Agile Methodologies

Safety-Critical Applications Built via Agile Discipline

Continuous Integration: Improving Software Quality and Reducing Risk. Preetam Palwe Aftek Limited

Agile Software Development

XP and Design. Paulo Caroli & Sudhindra Rao. ThoughtWorks

A Hybrid Design Methodology for an Introductory Software Engineering Course with Integrated Mobile Application Development

Testing Introduction. IEEE Definitions

Scenarios for Pair Coaching Exercises

XP & Scrum. extreme Programming. XP Roles, cont!d. XP Roles. Functional Tests. project stays on course. about the stories

Ingegneria del Software Corso di Laurea in Informatica per il Management. Agile software development

Tonight s Speaker. Life of a Tester at Microsoft Urvashi Tyagi Software Test Manager, Microsoft

On the Effectiveness of Unit Test Automation at Microsoft

AGILE SOFTWARE TESTING

Testing in Agile methodologies easier or more difficult?

Continuous Integration with Jenkins. Coaching of Programming Teams (EDA270) J. Hembrink and P-G. Stenberg [dt08jh8

Development Techniques. CSE301 University of Sunderland Harry R. Erwin, PhD

Software Development Going Incremental, Iterative and Agile:

A Lightweight Semi-automated Acceptance Test-Driven Development Approach for Web Applications

Preface Agile Testing Review

Defining Quality Workbook. <Program/Project/Work Name> Quality Definition

Schools of Software Testing

CMM Compliant XP. Abstract. Introduction

Introduction to Automated Testing

Nova Software Quality Assurance Process

Test Driven Development with Continuous Integration: A Literature Review

Enabling Continuous Delivery by Leveraging the Deployment Pipeline

Advanced Software Engineering. Software Development Processes

Agile QA s Revolutionary Impact on Project Management

Introduction to Agile Software Development

Topics covered. Agile methods Plan-driven and agile development Extreme programming Agile project management Scaling agile methods

Agile Software Development

Unit Testing webmethods Integrations using JUnit Practicing TDD for EAI projects

Life Cycle Models. V. Paúl Pauca. CSC Fall Department of Computer Science Wake Forest University. Object Oriented Software Engineering

The Agile Audit. 2. Requirements & Technical Architecture

The Effect of XP Testing on External Quality and Performance

Agile So)ware Development

Test-Driven Approach for Safety-Critical Software Development

AGILE SOFTWARE DEVELOPMENT A TECHNIQUE

Web Applications Development and Software Process Improvement in Small Software Firms: a Review

Driving Quality Improvement and Reducing Technical Debt with the Definition of Done

From Traditional Functional Testing to Enabling Continuous Quality in Mobile App Development

Methodology: Agile development of safety critical systems Annex D1.1.d to deliverable D1.1

Software Development Process

Codeless Test Automation for Web Apps

Agile Testing. What Students Learn

Transcription:

Test-driven development does it really ensure quality? Trial lecture Anca Deak 26 November 2015 Trondheim, Norway

2 Agenda Testing overview Agile unit testing What is TDD and why use it? TDD in literature Reflections on TDD Summary and future work

3 Software testing Software testing = process of analyzing a software item to detect the differences between existing and required conditions (bugs) and evaluate the features of the software item. (IEEE 829 ) Verification The software should confirm to its specification Are we building the product right? Validation The software should do what the user really requires Are we building the right product? Basically: check that the developed product meets the customer s requirements and expectations and the customer is happy!

4 Types of testing White box testing In white box testing internal structure of the program is taken into account Knowledge of the internal program design and code required. Tests are based on coverage of code statements, branches, paths, conditions.

5 Types of testing Black box testing No knowledge of internal program design or code required. In black box testing the internal structure of the program is hidden from the testing process Tests are based on requirements and functionality

6 Testing levels Unit testing Tests each module individually Follows a white box testing approach Done by developers Testing level where TDD is applicable

7 Testing levels Integration testing Checks for errors associated with interfacing. System testing The entire system is tested for requirements Overall system function and performance are checked Acceptance Testing It is performed by the customer at its site Determines if the delivered system is accepted or reject

8 Agenda Testing overview Agile unit testing What is TDD and why use it? TDD in literature Reflections on TDD Summary and future work

9 Agile software development SW Dev Method -small iterations -each iteration is complete dev. cycle -product is released after each iteration Benefits - fast feedback regarding the product - focus on people and interactions - working software is delivered frequently - face-to-face communication. - adapted to handle changes

10 Unit testing in agile Tools and technique employed for quality assurance: continuous integration automated unit testing pair programming domain-driven design code refactoring test-driven development

11 Testing levels and TDD

12 Agenda Testing overview Agile unit testing What is TDD and why use it? TDD in literature Reflections on TDD Summary and future work

13 TDD (Test Driven Development) An essential XP best practice, but can be applied as a stand alone one (Astels) A programming technique that promotes code development by repeating short cycles where each cycle combines Test-first development with refactoring. (Beck) Basically: Write a test before coding and refactor your code!

14 The TDD method The TDD method involves following steps: 1. Write a test for an unimplemented functionality or behavior; 2. Supply the minimal amount of code; to pass the test; 3. Refactor the code; 4. Check that all tests are still passing after the changes were done.

15 Perceptions of TDD Primarily a development technique Design style refactoring = refine the component design Testing technique Does not replace traditional testing, but ensures effective unit testing Helps in clarifying the requirements involves analyzing the requirements of a portion of an implementation

16 Why use TDD? Make you think twice about the requirements Test coverage - code is never written without first writing a test Documentation writing tests describe your understanding of code behavior Confidence increase for developers Increases the reliability of the developed product

17 More on Why use TDD? Less debugging required especially for the Greenfield projects Increased protection from defects You will know that if it fails, it was the last change who broke it Creates a base catalog for automation

18 Agenda Testing overview Agile unit testing What is TDD and why use it? TDD in literature Reflections on TDD Summary and future work

19 How to evaluate TDD effectiveness The body of knowledge has measured the TDD effectiveness by looking at : Internal code quality External code quality Productivity

20 What is software quality? Software functional quality reflects how well it complies with or conforms to a given design, based on functional requirements or specifications Software structural quality refers to how it meets non-functional requirements that support the delivery of the functional requirements, such as robustness or maintainability.

21 Internal quality Internal quality: evaluates the internal design of the code as seen by developers code and test coverage good auto-documentation code complexity concision cohesion

22 External quality External quality: indicated by number of defects per code size unit or passing test cases all the properties of the software as a product that make this product usable and enjoyable reliability accuracy ease of use and comfort adaptability

23 Productivity Productivity measures the development effort as the number of given units in a given time frame lines of code per hour (code standard, right metric) number of user stories implemented Measuring programming progress by lines of code is like measuring aircraft building progress by weight. (Bill Gates)

24 TDD in Literature Findings from literature show contradictory and varying results for TDD Positive influence External quality is positively influenced by the TDD (Nagappan et al.) Improvement of productivity (Erdogmus et al.) High test coverage Negative or inconclusive results Decrease in quality Lower productivity No difference

25 Review of Literature reviews Findings from literature reviews show contradictory and varying results for TDD Literature reviews Year Objec1ves Kollanus 2010 TDD effects on Quality and Produc8vity Sfetsos and Stamelos 2010 Agile prac8ce(tdd, pair programming) influence on Quality and Produc8vity Shull et al. 2010 TDD effects on Internal Quality, External Quality and Produc8vity Turhan et al. 2010 TDD effects on Internal Quality, External Quality and Produc8vity Rafique and Misic 2011 TDD effects on External Quality and Produc8vity Munir et al. 2015 Review of literature reviews with focus on rigor and relevance

26 Results from literature reviews - rigor and relevance A lack of rigor was highlighted in the existing research Insufficient details about context Poor study design Threats to validity not addressed Relevance of the studies were also under discussion Practical impact of the results Realism of the setup

27 Results from literature reviews (1) Using small sets of observed parameters/metric made it difficult to compare the results between studies Different results between experiments and case studies Experiments with students are not best suited, longer and more complex projects are recommended Semi-industrial environments where proposed

28 Results from literature reviews (2) Seasoned developers were more willing to work with TDD than fresh programmers Further industry experiments and longitudinal case studies are recommended External quality is positively influenced by TDD but comes with a decrease of productivity

29 Limitations of TDD (1) Adopting TDD leads to reduced productivity in the beginning. (more time needs to be allocated for creating tests) Not suited for non-functional requirements, data base testing, network configuration, or hardware related issues running these tests will take too much time or require specific settings Change of business requirements requires rewriting of the test or rends them unusable

30 Limitations of TDD (2) Not over rely on TDD: all the tests pass should does not imply that the code is bug free Developers have to learn to write unit tests As the product complexity increases, more tests will take more time to write, to run and to maintain Depends on programmer motivation and discipline Some developers simply don t like to write tests

31 Agenda Testing overview Agile unit testing What is TDD and why use it? TDD in literature Reflections on TDD Summary and future work

32 Reflections on TDD (1) It is used in the first phase of implementing a software product It s a practical way of documenting and building automation Coupled with pair programming, it increases communication in the team and can be used as a mentoring process

33 Reflections on TDD (2) Not practical for handling legacy code but refactoring legacy code provides opportunity to write unite tests. The use of TDD tends to decrease when the software complexity increases

34 Reflections on TDD (3) Testing frameworks provide a practical approach for performing TDD and tracking test status by running reports.(junit, Google Test) Continuous Integration provides an automatic and fast way of checking the unit test status

35 Agenda Testing overview Agile unit testing What is TDD and why use it? TDD in literature Reflections on TDD Summary and future work

36 Summary TDD effectiveness is likely to vary from context to context (team to team, product to product) Claims of improved quality which are sometimes coupled with a decrease of productivity due to more time allocated to writing tests There is little data to support claims of improved productivity or software design (low level design).

37 Recommendations for future work Further empirical studies on TDD: Increased validity Common metrics for internal code quality Longitudinal studies in industry

38 Thank you! Q&A

39 References - 1 1. Astels, D.: Test-driven development: a practical guide. Prentice Hall PTR (2003). 2. Nagappan, N., Maximilien, E.M., Bhat, T., Williams, L.: Realizing quality improvement through test driven development: results and experiences of four industrial teams. Empir. Softw. Eng. 13, 289 302 (2008). 3. Beck, K.: Test-driven Development: By Example. Addison-Wesley Professional (2003). 4. Erdogmus, H., Morisio, M., Torchiano, M.: On the effectiveness of the test-first approach to programming. IEEE Trans. Softw. Eng. 31, 226 237 (2005). 5. Kollanus, S.: Test-Driven Development - Still a Promising Approach? 2010 Seventh Int. Conf. Qual. Inf. Commun. Technol. 403 408 (2010). 6. Sfetsos, P., Stamelos, I.: Empirical Studies on Quality in Agile Practices: A Systematic Literature Review. Quality of Information and Communications Technology (QUATIC). pp. 44 53 (2010).

40 References - 2 7. Shull, F., Melnik, G., Turhan, B., Layman, L., Erdogmus, H., Diep, M.: What Do We Know about Test-Driven Development? IEEE Softw. 27, 16 19 (2010). 8. Turhan, B., Layman, L., Diep, M., Erdogmus, H., Shull, F.: How Effective is Test-Driven Development? Making Software: What Really Works, and Why We Believe It. pp. 545 552 (2006). 9. Rafique, Y., Mi, V.B.: The Effects of Test-Driven Development on External Quality and Productivity: A Meta-Analysis. IEEE Trans. Softw. Eng. 39, 835 856 (2013). 10. Munir, H., Moayyed, M., Petersen, K.: Considering rigor and relevance when evaluating test driven development: A systematic review. Inf. Softw. Technol. 56, 375 394 (2014).