The Way of the Web Tester

Leave a comment

Screen Shot 2016-09-15 at 5.45.37 AM.png

Hello everyone. A book I have been working on diligently for the last two years has finally hit the shelves. It’s called The Way of the Web Tester and it’s a book for anyone who wants to learn how to write automated tests for the web.

What’s in this book?

The book starts out by explaining what the three kinds of tests are that we typically see in web projects, along with some rules of them and guidance on where and when to use each.

We they spend a full two chapters at each level of something called the testing pyramid seeing how to add UI tests to legacy systems, how one can test web services, along with some rules of thumb around unit testing. That’s Part I.

Screen Shot 2016-09-15 at 6.25.50 AM.png

In Part II we build on the concepts outlined in the testing pyramid, but shift our focus to those skills specifically geared towards writing good tests.

First we look at some of the basics of programming, and show how by learning a few simple principles and practices we can dramatically increase the readability and maintainability of our automated tests.

We then look at some practices around test organization, and see how by simply grouping and organizing our tests in certain ways can make maintaining our tests so much easier.

And in the chapter on effective mocking, we look at some of the perils that come with this style of unit testing, and see how we can use mocks effectively while staying out of the swamp of mocking.

And we conclude with a section on the art of writing tests first. And see how beginning with the end in mind not only helps you test your systems, it can actually help you iterate on your design.

Who is this book for?

Screen Shot 2016-09-15 at 6.52.26 AM.png

If you are a tester who’s always wanted to get into test automation, this is the perfect book for taking that first step into a larger world.

If you are a developer, and you’d like to learn how to make your code even more robust, this book will show you how to move fast without breaking stuff.

And if you are team lead, looking better ways to get your testers and developers together, his is the Rosetta Stone you’ve been looking for.

Once your team has a common framework, language and understanding around automated testing, they will be able to better coordinate they’ll their efforts and write the best automated tests for your project.

So wait no further. Crush bugs. Move fast. And have fun. I hope you enjoy The Way of the Web Tester.

On sale now at all reputable book stores.

https://pragprog.com/book/jrtest/the-way-of-the-web-tester

https://www.amazon.com/Way-Web-Tester-Beginners-Automating/dp/1680501836

 

Advertisements

How Facebook pushes new code live

16 Comments

This weekend at Hackernews I stumbled across a great video showing how Facebook pushes new code live.

It’s the most advanced push deployment system I have seen.

The video is excellent. If you are into software, looking for advanced build and deploy techniques, or just looking for ammunition to improve your own build and deploy process, watch this video.

Here are some of the highlights.

Culture

We operate at ludicrous speed and massive scale.

Tools are not going to solve your problem.
It’s about culture.

No big fat layer of QA, managers and adult supervision.

500 core engineers.

As a developer you will shepherd your changes out from the time you check it into trunk, to the time you release it out to your mom.

There is no army of people who are going to vet it and check it.
You are accountable.

Subversion and git are used for version control.
UI tests are Watir and Selenium.

Oncall duties are serious. When you are on call, you are the guy.

Branching

Generally don’t branch. All work done off trunk. You work. You checking. Bam. You’re done.

Cut one week release branches.

Your change can go out with the weekly deploy, or you can bump it up into the daily deploy.

Testing

Everyone tests at Facebook all the time.
Anyone can open a bug – there is a Facebook group internally anyone can go to to see the latest bugs, and open any new ones they find.

Everything is automated. Here are few of the tools Facebook uses internally to do pushes.

IRC bots

These bots are there to tell you the state of your push.
Don’t bug a deployment engineer asking where you code is.
Ask the bot.

When you push is going live, the bot will ping you and ask you if you are here.
You are to respond, and let support know that you are here to help if needed.
You are on standby.
For a daily push, if you don’t do this, your rev doesn’t go out.

Test Console

Built there own test console to show the state of there tests.
Use Watir, Selenium, + bug suite of unit tests.

Console will not only show which tests are broken, they will show when the test broke, and who’s change broke it.

Shadow branch

Production + changes + tests

Shadowing prod.
This is the working prod changes changes are merged to.

Error tracking (18min)

php errors. Exceptions. Fatals. All the things going wrong.

Can see calling stack for all errors on the site.
Will show subversion blame for that line of code.

Gatekeeper (24min)

This is the tool/process that impressed me most out the the entire press.

Gatekeeper always Facebook to incrementally push changes to the live website, and then turn them on or off in very complicated selected ways (basically a big conditionally).

For example, you could push some new changes live (that you aren’t about) and then only expose them to:
– Employees only
– By country
– Age
– IP
– East coast/West coast
– Anyone but TechCrunch 🙂

You can bump public up ot 1%. In minutes you will get a million hits.
You can grab the data, turn it back down. Make changes. And then turn it on again.

Super cool feature that let’s you ease it out.

Push Karma (25min)

Basically a Karma system where by you are assigned a Karma score (4 stars) and every time you screw up a push, you lose Karma.

Great way for putting accountability on the engineers to make sure their changes make it live OK, and don’t cause the build engineers any pain.

HipHop for PHP (29min)

PHP compiler.
PHP is crappy and slow. So they make a compiled version of PHP.
Generates highly optimized C++ and converts into giant 1 GB binary – which is Facebook in it’s entirety.
Takes a couple minutes.
Savings are 50% performance boost.
Less hardware required.
Open source.

BitTorrent (31min)


Facebook pushes it’s 1GB binary of compiled PHP to it’s 10,000s of servers using BitTorrent.

Very cool. Rack affinity – looks locally first before going out to neighbours.
Ridiculous data speeds.
Can roll Facebook.com in about 15min.
Whole site.
Incredible.
Minimal user impact.

Summary

Tools alone won’t save you.

But you need the right people.
But you need the right culture.
But you need the right company.

Watch the video.

Best software engineering course ever!

8 Comments

This week I received an email from Tobias Pfeiffer, a student studying software engineering at the Hasso Plattner Institut in Germany, saying … well I will let him say it:

Hello Jonathan,

I am a german student. I am currently making my bachelor degree in IT-Systems Engineering at the Hasso-Plattner-Institute Potsdam.
I just wanted to let you know what a great read your book “the agile samurai” was to me. I started reading it the evening before my exam in Software Engineering II (which is mainly about Scrum) basically because I didn’t know what else to learn and I was looking for some enlightment.
It was so entertaining that it was hard for me to stop reading it and go to bed. Now I read the whole book and really kudos to you, I learned very much despite having finished two full blown courses about agile software practices. The humor and all the pictures are great as they lighten up the book.

The inception deck is great and I wish we would have done one at the beginning of our bachelor project.

You tipped my preference for a future job a bit more into the direction of an agile team member/ project manager/ agile coach.

Also thanks for all the work experiences you shared and all the books you recommended, I’ll make sure to read some of them.

So keep up the good work and have a great week!
Greetings,
Tobias Pfeiffer

After thanking Tobias for his kind words I dug a little deeper into what this second year software engineering course he was taking was about. In a nutshell it looks awesome.

Check out this course outline:

(may need to accept a certificate before viewing)

* 22.10.2010: Course Introduction
* 22.10.2010: Rails Introduction
* 22.10.2010: Exercise
* 29.10.2010: ERP Introduction
* 29.10.2010: CRM Introduction
* 29.10.2010: Collaboration Environment
* 05.11.2010: Lego Exercise
* 05.11.2010: Git Introduction
* 12.11.2010: BDD & Testing (in Rails)

And of course I dig their recommended reading of Pragmatic Programmer Books:

This is the kind of course I would have given my … would have loved to have when I was studying engineering.

You not only learn agile, you get to practice it in a team, building a product using Rails (a framework built for agility) while getting to practice all the best software engineering techniques like TDD, refactoring, continuous integration, and unit testing.

Check out the links above. It’s excellent material and it’s all free.

If you are doing this at your school or university let me know. I would love to give you a shout out as this stuff is important.

Thank you Tobias for the kind words. Would love to meet some day. As someone currently learning Rails myself this is the kind of course I would love to take.

Video of Tobias doing lego exercise (he is the curly haired fellow on the left).

%d bloggers like this: