ABAPCodeRetreat - TDD Intro by Damir Majer

Preview:

Citation preview

@majcon

Test-Driven Development

ABAPCodeRetreat de Meern 2017

2

Damir Majer Developer, Dev Coach and Trainer @majcon

Unit-Tests mit ABAP® Unit dpunkt.verlag

Besseres ABAP Schnell, sicher, robust SAP Press

CodeKata ABAP Collaboration Project www.codekata.io

Software development is complex

Copyright Majer Consulting

hey boss everything is under control…

how is presented how the truth is

Systematic testing

5

Testing techniquesAd-hoc testingError guessing

Boundary value analysis Path coverage testingIntuitive testing

Semantic testingControl flow testing Business process testing

Branch coverage testing

State transition analysisCondition coverage testing

Cause-effect analysis Dataflow testing

Classification tree method

Compiler testingTesting in pairs

Elementary comparison test

Weak point testing

Area analysis testing

Equivalence class partitioning analysis

Testing with a random value

Syntax testing Statement coverage testing

How to achieve testing during the implementation phase?

Unit vs. integration testing

7

Integration testing Unit testing

Unit-Testing

“unit testing is a software testing method

by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures,

are tested to determine whether they are fit for use

WIKIPEDIA:

Test-Driven Development

“is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. This is opposed to software development that allows software to be added that is not proven to meet requirements.

…TDD encourages simple designs and inspires confidence.

Test-driven development is related to the test-first programming concepts of extreme programming, begun in 1999,

but more recently has created more general interest in its own right.”

WIKIPEDIA:

11and now?

Execution of ABAP Unit-Tests SAP GUI or ABAP in Eclipse:

CTRL+SHIFT+F10

ABAP Unit on a Postcard

plan actualvs.

ABAP Unit Assertion-Methods

Test Driven Development

• write a test • make it fail • keep it simple • tests are examples • tests becomes

documentation

abapcoderetreat.events ACR

RED GREEN

REFACTOR

• get to green fast • take baby steps • stuck? undo and start

over • write only enough code

to pass the test

• remove duplication (in code and tests)

• rename and clean up • run tests and stay green • change implementation

not behaviour • improve structure in

small steps

you start here!

What is your experience?

one more thing…

ABAP Trainings with focus on ABAP Unit and TDD

WDE401WDAGIL

BC401

TDD with ABAP cATDD

Hands on…