Use of special software (separate from the software being tested) to control the execution of tests and the comparison of actual outcomes with predicted outcomes.
The presentation covers:
Why Automate, Test automation basics and about the Mocha framework.
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Test Automation - Presented by Nagarajan, Architect @ TechCafe-2014
1. Testing Automation
– As presented by Nagarajan Selvarajan,
Technical Architect @ Techcafe -2014
2. Magento
Hybris Commerce
SaaS Applications
Adobe Marketing Cloud
Custom Development
300+ team with experience
in managing offshore,
distributed development.
Neev Technologies
established in Jan ’05
VC Funding in 2009 By
Basil Partners
Part of Publicis Groupe
Hybris and Adobe CQ
centers of Excellence
Offices at Bangalore,
Gurgaon, Pune, Mumbai
Member of NASSCOM
Key Company Highlights
iPhone
Android
PhoneGap
Windows Phone
HTML5 Apps
Web
AWS
Rackspace
Joyent
Heroku
Google Cloud Platform
Mobile Cloud
Outsourced Product Development
User Interface Design and User Experience Design
Performance Consulting Practices
Quality Assurance & Testing
Digital Marketing, CRM, Analytics (Omni-Channel)
About Neev
3. Use of special software (separate from the software being
tested) to control the execution of tests and the comparison
of actual outcomes with predicted outcomes.
What is Test Automation?
4. • Saves Time & Money in comparison with Manual testing whether you
retrofit your existing code with tests, or make test automation a
requirement for all future development, it's a good investment.
• Unleash the power of Agile development - test automation and continuous
integration are the cornerstones of Agile development.
• Create a Safety Net - Trying new things can be scary. But with the safety of
automated tests, developers have the freedom to innovate knowing that
any "gotchas“ will be immediately apparent.
Why Automate?
5. • Catch more bugs - repetitive tasks like manual testing numb the mind and
invite mistakes. Testers slowly become less focused on their task, and are
more likely to let defects slip through. But a computer isn't affected by this
phenomenon. So, automation ensures that each test is rigorously executed
every time.
• Foster new skills on your team - QA engineers and developers are inquisitive
people by nature. So why not channel that curiosity into acquiring new skills?
• Testers who learn how to code - and coders who learn how to think like
testers – become empowered, indispensable members of the team. And
team members who cross-train in each other's skills also learn to work better
together.
Why Automate?
6. • Practice Continuous Integration - Testing changes right away dramatically
reduces the cost of addressing defects, so kick off a build with each commit,
or at scheduled intervals throughout the day.
• Run automated tests in parallel - Breaking a test suite into smaller batches
by functional area, level of the technology stack (unit, API, UI, etc) and
running them simultaneously is the fastest way to provide feedback to
developers.
• Practice continuous integration on branches - working in isolation on a
branch gives developers room to experiment and protects the master code
line from regressions - if the branch is tested as rigorously as the master.
Test Automation Basics
7. • Apply your continuous integration scheme to new branches as soon as they
are created. Pull in changes from other team members frequently to
uncover compatibility problems and ease the final integration with master.
• Quarantine flakey tests - When the problem can't be fixed right away, pull
the test out temporarily. Quarantined tests should be run separately and
reincorporated into the main build as soon as possible.
Test Automation Basics
8. • JavaScript test framework running on Node.js and the browser, making
asynchronous testing simple. s
• Assertions - Assertions libraries like should.js and expect.js can be used.
describe('Array', function(){
describe('#indexOf()', function(){
it('should return -1 when the value
is not present', function(){
[1,2,3].indexOf(5).should.equal(-1);
[1,2,3].indexOf(0).should.equal(-1);
})
})
})
Mocha
9. • Synchronous support
describe('Array', function(){
describe('#indexOf()', function(){
it('should return -1 when the value is not present', function(){
[1,2,3].indexOf(5).should.equal(-1);
[1,2,3].indexOf(0).should.equal(-1);
})
})
})
Mocha
10. • Asynchronous support
describe('User', function(){
describe('#save()', function(){
it('should save without error', function(done){
var user = new User('Luna');
user.save(function(err){
if (err) throw err;
done();
});
})
})
})
Mocha
11. • Hooks - Before each, After each
beforeEach(function(done){
db.clear(function(err){
if (err) return done(err);
db.save([tobi, loki, jane], done);
});
})
describe('#find()', function(){
it('respond with matching records', function(done){
db.find({ type: 'User' }, function(err, res){
if (err) return done(err);
res.should.have.length(3);
done();
})
})
})
})
Mocha
12. • Pending tests
describe('Array', function(){
describe('#indexOf()', function(){
it('should return -1 when the value is not present')
})
})
Mocha
13. • Reporting
– Types of reporting (Spec, Progress bar, JSON, Dot, etc)
– Test duration with color indicator (slow, reasonable, fast)
– Report differences (actual vs expected)
Mocha
15. nagarajan@Neev:~/ mocha --reporter=spec
--timeout 120000 test/api_fileupload
Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-
stringprep`
Media asset (picture) upload
✓ Start session API: should succeed on valid inputs (57ms)
✓ should upload file in parts (29032ms)
Sensory data upload
✓ Start session API: should succeed on valid inputs (136ms)
✓ should upload sensory data (22176ms)
4 passing (57s)
Mocha
18. India - Bangalore
The Estate, # 121,6th Floor,
Dickenson Road
Bangalore-560042
Phone :+91 80 25594416
Neev Information Technologies Pvt. Ltd. sales@neevtech.com
India - Pune
Office No. 4 & 5, 2nd floor, L-Square,
Plot No. 8, Sanghvi Nagar, Aundh,
Pune - 411007.
Phone :+91 20 64103338
For more info on our offerings, visit www.neevtech.com
Editor's Notes
Definition of terms1. Revenue refers to total revenue Jan-Dec2. Gross margin as defined in key metric template3. Net new business refers to ‘New new business’ i.e. non organic growth. It should not include growth from existing clients.