Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Automated testing
Search
Marc Tamlyn
July 12, 2013
Programming
3
190
Automated testing
They why, what and how of automated testing for a mixed technical and non-technical audience.
Marc Tamlyn
July 12, 2013
Tweet
Share
More Decks by Marc Tamlyn
See All by Marc Tamlyn
Arousal and Anxiety
mjtamlyn
1
42
Working with Children
mjtamlyn
1
69
Wallingford Castle Archers Incorporation
mjtamlyn
0
170
Observation and Evaluation
mjtamlyn
0
87
Weird and Wonderful things to do with the ORM
mjtamlyn
3
1.3k
An Introduction to Graphene and Relay
mjtamlyn
6
1.2k
Tech Interviews that don't suck
mjtamlyn
4
1k
Data driven rendering
mjtamlyn
1
150
What's new in Django 1.9
mjtamlyn
1
170
Other Decks in Programming
See All in Programming
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
300
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
430
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
570
Rubyでつくるパケットキャプチャツール
ydah
0
170
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
AHC041解説
terryu16
0
400
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
7
1.4k
functionalなアプローチで動的要素を排除する
ryopeko
1
220
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.4k
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
1.4k
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Optimizing for Happiness
mojombo
376
70k
GitHub's CSS Performance
jonrohan
1030
460k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Mobile First: as difficult as doing things right
swwweet
222
9k
Transcript
Automated Testing Lunch n Learn @incuna
What is it? • Unit tests • Integration tests •
Functional/acceptance tests • Visual tests • Regression tests
Why? • Trust in the code • Freedom to refactor
• Reduce number of bugs
What is it not? • A complete replacement for QA,
a useful tool for doing QA • For content
Types of test
Unit tests • Test small specific pieces of functionality •
Cover as many cases as possible • (Should be) quick and easy • Fragile but isolated • Mock out other layers • Coverage
Integration tests • Work across multiple layers of the program
• Ensure all the individual pieces fit together • Simulate real requests • Test only “normal” things • Should break less often
Functional or Acceptance tests • Test the whole system •
Test user stories • “Open up browser, go to home page, click on login link, fill in correct information, redirects to profile page, click on forum navigation, make a post, post appears on page...”
Functional or Acceptance tests • SLOW, and harder to write
• More likely part of the QA process than the development process • Immensely useful for front end logic
Visual tests • Does this page look like this screenshot?
• Cross browser • Needs research...
Regression testing
Regression tests • “AAAA this is broken we must fix
it now” • “I’ll write a test for it” • A bug is not a bug, it’s a missing test • Makes sure the bug doesn’t come back
Regression tests • Could be any one of the other
kinds of test • Never get written if the project didn’t have tests to start with
Continuous integration
Continuous integration • Runs test suite against changes and pull
requests • Warns us if someone breaks things • Runs in a production-like setting
Test driven development
Test driven development • Write the tests first • Add
code afterwards • (Refactor) • Check tests still pass • Repeat
Test driven development • Feels slower to start with •
More reliable than “refreshing the page to see if it worked” • Requires good tools • Saves time (and face) in the long run
Live demo time!