Golo Roden

How not to test

If your code is hard to test, it's not because the problem is complex. It's because the code itself is poorly structured.

How not to test
#1about 6 minutes

The journey from manual execution to automated testing

Early programming involved manually running code to verify it, but the rise of concepts like Test-Driven Development (TDD) introduced the power of automated testing.

#2about 7 minutes

Difficult-to-test code is a symptom of poor design

Code that is hard to test is often a sign of poor structure with too many dependencies, not an inherent problem with the complexity of the task itself.

#3about 6 minutes

The pitfalls of testing private implementation details

Avoid trying to test private code directly through hacks like reflection, as tests should focus on the public behavior and interface of a component.

#4about 5 minutes

Why 100% code coverage is a misleading metric

Achieving 100% code coverage is often a false positive because it only confirms code execution, not the quality or relevance of the tests themselves.

#5about 5 minutes

The dangers of overusing mocks in integration tests

Relying heavily on mocks can create a false sense of security, as they may not accurately replicate the behavior of real dependencies like databases.

#6about 2 minutes

Ensuring test independence with clean infrastructure setups

Tests should be independent and start from a clean slate by automating the setup and teardown of infrastructure for each run using tools like Docker.

#7about 4 minutes

Handling asynchronicity in UI component testing

UI tests must account for asynchronous operations like animations and transitions, as assuming synchronous behavior will lead to flaky and unreliable results.

#8about 4 minutes

Writing story-based UI tests instead of fine-grained ones

Full UI tests using tools like Selenium are slow, so they should focus on broad, story-based user flows rather than fine-grained component interactions.

#9about 3 minutes

Applying Test-Driven Development (TDD) strategically

TDD is most effective when you have a clear goal and can be counterproductive during prototyping; it's best to explore ideas first, then rebuild with TDD.

#10about 2 minutes

Adopting a reasonable and pragmatic testing approach

The goal of testing is not perfection but to provide reasonable confidence, so focus effort on what is valuable to test rather than blindly chasing metrics.

Related jobs
Jobs that call for the skills explored in this talk.

test

Milly
Vienna, Austria

Intermediate

test

Milly
Vienna, Austria

Intermediate

Featured Partners

Related Articles

View all articles
KP
Kate Passby
How to create a test plan for software testing
When creating new software, it's important to put it through rigorous testing. This improves IT security and helps to identify any problems. As software developers, the aim is to make the process of testing as painless as possible. This ensures the s...
How to create a test plan for software testing
AP
Anto Pranjić
11 Tips to Make The Most Out of Your First World Congress 
The world’s most awesome event for developers is taking place in less than a month! It’s been far too long since the last time we met in person, but that’s only going to make this year’s WeAreDevelopers World Congress a truly special experience. Conf...
11 Tips to Make The Most Out of Your First World Congress 

From learning to earning

Jobs that call for the skills explored in this talk.