Testing SAP: Modern Testing Methodologies: Ethan Jewett
Testing SAP: Modern Testing Methodologies: Ethan Jewett
Ethan Jewett
But first!
Budget
Risk
Duration
Budget
Quality
Time
Client requests
Build Faster And produce more Value Cheaper with less Risk
Remember
Value
Budget
Risk
Duration
Test Fix
Transport
Go Live
Live Support
Training
The topic
Over the next hour and a half, well talk about how testing methodologies, techniques, and technologies can help us Change these underlying assumptions. Enable modern project methodologies. Control the basic project trade-off.
The focus
Project Preparation Business Blueprint Project Realization
Test Fix
Transport
Go Live
Live Support
Training
The goal
More value Faster With less risk
(and more fun)
For example
V-Model methodology
http://en.wikipedia.org/wiki/File:V-model.JPG
http://en.wikipedia.org/wiki/File:V-model.JPG
Faster
http://en.wikipedia.org/wiki/File:V-model.JPG
More iterative
http://en.wikipedia.org/wiki/File:V-model.JPG
Modern methodology
Modern quality assurance and testing
Leading practice in custom development, open source, and agile projects
Test driven development (TDD), behavior driven development (BDD), readable tests, executable requirements, continuous integration
Overview of the SAP test automation technologies Road we're going to take through testing SAP
Leading Practice
Context Questions and problems Approaches Tools
Leading Practice
Context Questions and problems Approaches Tools
Context
The context of modern software development is above all open, agile and decentralized. Open source projects are usually the furthest along this path, and as such these projects use (or are forced to invent) tools that fit their processes.
Openness
Requirements, specifications, issues reports, test cases, source code, and project tools and metrics are readily open and available to all participants in the project. (Not necessarily the same as open source.)
Agility
The values of the Agile Manifesto:
Individuals and interactions over processes and tools Working software over comprehensive documentation Customer collaboration over contract negotiation Responding to change over following a plan
http://agilemanifesto.org/
Decentralization
Open-source projects are decentralized by nature, but most organizations today have some element of decentralization Challenges:
Quality control Communication Maintaining commitment
Leading Practice
Context Questions and problems Approaches Tools
Leading Practice
Context Questions and problems Approaches Tools
Approaches
Test Coverage Test Automation Test Driven Development Behavior Driven Development Spec as Test (the test/spec convergence) Exploratory Testing Continuous Integration
Test coverage
The percentage of code or development that is tested. In code, this might be measured by determining if every branch of code can result in a failing test condition (Branch coverage)
Wikipedia - http://en.wikipedia.org/wiki/Code_coverage
Test automation
Accepted as gospel modern dev communities
Regardless of how good they are at testing, accept that they should automate as much as possible Can lead to ignoring non-automatable testing
In the SAP world we havent even accepted that full test coverage is desirable, much less automation
Test automation pushback http://railspikes.com/2008/7/11/testing-is-overrated http://michaelfeathers.typepad.com/michael_feathers_blog/2008/06/the-flawedtheo.html Automated testing story on SDN (never completed) https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4103
Design
Test
Technical specification
Design
Write tests based on specs
Build
Write code to address test failures
Run tests
Design
Test
Test
TDD Example
require test/unit require test/unit/assertions require bowling
class TC_Bowling < Test::Unit::TestCase def setup bowling = Bowling.new end def gutter_game 20.times { bowling.hit(0) } assert bowling.score == 0 end end
BDD example
require spec require bowling
describe Bowling do
These frameworks wrap TDD and BDD frameworks and allow for business-writable, business-readable, executable test scripts.
Feature example
Feature (visible to the user) Implementation (not visible to user)
require spec/expectations require bowling
Given /I have knocked over (\d+) pins per ball/ do |pins| @pins_per_ball = pins end Given /I have bowled (\d+) balls/ do |balls| @bowling = Bowling.new balls.times { @bowling.hit( @pins_per_ball ) } end Then /I should have (\d+) points/ do |points| @bowling.score.should == points end
Scenario: Gutter game Given I have bowled 20 balls and I have knocked over 0 pins per ball When I check the score Then I should have 0 points
Side-by-side
TDD
require test/unit require test/unit/assertions require bowling class TC_Bowling < Test::Unit::TestCase
BDD
require spec/expectations require bowling describe Bowling do
Spec as Test
Scenario: Gutter game Given I have bowled 20 balls and I have knocked over 0 pins per ball
Spec as test
Cucumber - http://cukes.info/ Rspec - http://rspec.info/ http://www.pragprog.com/titles/achbd/the-rspecbook
Exploratory Testing
The practice of trying to break things
Career security for klutzes
Exploratory testing appears informal, but can be structured and is a very important aspect of software testing.
Probably the most neglected form of testing in open source projects
http://www.kohl.ca/blog/archives/000185.html http://www.kohl.ca/articles/ExploratoryTesting_MusicofInvestigation.pdf
Continuous Integration
The practice of automating not only your tests but your full commit-build-test cycle
1. A commit new or changed code 2. Triggers a full system build 3. And an execution of the entire test suite
Leading Practice
Context Questions and problems Approaches Tools
Tools
Source version control (svn, git) Testing libraries (rspec, cucumber, junit, ABAPunit, jspec) Continuous Integration tools (cruisecontrol.rb, Hudson) Issue tracking (Sourceforge, trac, Lighthouse, Google Code) Agile methodologies (Scrum, XP, etc.)
Modern methodology
Modern quality assurance and testing
Leading practice in custom development, open source, and agile projects
Test driven development (TDD), behavior driven development (BDD), readable tests, executable requirements, continuous integration
Overview of the SAP test automation technologies Road we're going to take through testing SAP
Functional testing
eCATT
ABAP Unit
Modeled on Java Unit Excellent (if a bit unwieldy) for traditional unit test automation or classes
Works well for TDD
Non-SAP
We can use just about anything via RFCs For Web Dynpros, BSPs, or Portal applications, there are a lot of options using web-drivers that can automatically drive browsers Address in depth in future sessions
Modern methodology
Modern quality assurance and testing
Leading practice in custom development, open source, and agile projects
Test driven development (TDD), behavior driven development (BDD), readable tests, executable requirements, continuous integration
Overview of the SAP test automation technologies Road we're going to take through testing SAP
http://en.wikipedia.org/wiki/File:V-model.JPG
Spec = Test
http://en.wikipedia.org/wiki/File:V-model.JPG
Get faster
Test Automation
http://en.wikipedia.org/wiki/File:V-model.JPG
Get iterative
Continuous
Integration
http://en.wikipedia.org/wiki/File:V-model.JPG
http://en.wikipedia.org/wiki/File:Scrum_process.svg
Thanks
Exploratory testing
The ongoing revolution in software testing ABAP Unit Load testing Joel Spolsky 12 steps to better code - http://www.joelonsoftware.com/articles/fog0000000043.html Automated testing story on SDN - https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4103 JUnit - http://www.junit.org/ Open Source
http://www.paulgraham.com/opensource.html (What business can learn from open source) http://wtr.rubyforge.org/ Cucumber - http://cukes.info/ Rspec - http://rspec.info/ http://www.pragprog.com/titles/achbd/the-rspec-book http://www.beteoblog.com/beteo-alm-miniguides/software-quality/ http://raa.ruby-lang.org/project/saprfc/ Integration Tests in ABAP Development und Tool Support - https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/7131 XSLT - https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12173 http://railspikes.com/2008/7/11/testing-is-overrated http://michaelfeathers.typepad.com/michael_feathers_blog/2008/06/the-flawed-theo.html
Watir
Spec as test
SAP testing