Beautiful Scripts

Most testers I’ve seen just write test scripts without ever going near the formatting options – this is such a waste!
Consider the below two examples:






1. Login to application
2. Access Subscriptions form
3. Add a subscription with Name=”Test Subscription AD01″, Start date=”01/01/11″, End date = “31/12/15”
4. Save record
5. Close the form

1. Login to application

2. Access Subscriptions form

3. Add a subscription with
Name=”Test Subscription AD01“,
Start date=”01/01/11“,
End date = “31/12/15

4. Save record

5. Close the form

Which of the following is easier to read? Imagine that simple test scaled up to a 30-40 step test, and how much easier to interpret it would become with formatting.

Even Excel allows for different formatting within the same cell, so there’s no excuse not to do it.
Choose your own standard, but I tend to make names of forms, windows columns, fields etc. bold. Key actions (e.g. Login) are also bolded. The actual data is marked bold and red.

Of course, I’m not advocating spending hours needlessly turning your scripts into a work of art, but adding some basic formatting will improve readability and acts as a review period, when you can step back for a second and look at what you’ve just written.

Advertisements

2 comments

  1. Notepad++ has a cool feature that allows the user to develop formatting for their own custom ‘language’. You can define keywords as one color, ‘values’ another color and even select your own categories (form names in your case).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s