Secrets of developping quality web application applications super fast : automated testing + CI

Posted by on November 03, 2013|Read full article

I talked and wrote a lot about test automation and continuous integration, which are the key reasons behind the success of some big names such as Facebook and LinkedIn. ("FaceBook pushes two releases per day"; LinkedIn joined to this elite club by "luring" Kevin Scott, the senior vice president of engineering and longtime Google veteran, "completely overhauled how LinkedIn develops and ships new updates" (wired magazine called this 'software revolution'). While few of my audience or readers deny the importance and benefits of automated testing and CI, some of them (I feel) thought these can only be done by software giants. Many failed (including some wise testers who purchased TestWise) due to the lack of motivation.

As a matter of fact, test automation and CI are vital to small projects just as to the big ones, if not more. Automated tests and CI compensate the usually limited testing and deployment resource often found in small teams. The very few companies who have done well wouldn't share how they apply test automation and CI (like Google and FaceBook), as they usually regard it as a secret. To be fair, while the technologies are usually open (such as Selenium, Jenkins), the application of test automation and CI varies (not much) due to the nature and culture of the business.

I share our secret here, on how we applied automated testing and CI to one of our new product: ClinicWise, an online clinic management software. The project was started as a side project about a year ago. A relative of mine, a dentist was about to open a dentist clinic, looking for a dental clinic software. He has used many of them before, but was not happy with any of them (too many bugs, complex and very expensive). For some reason, I offered a try to develop a customized application for him. Looking back now, it sounds a bit crazy, as I had no background in this health care area and the client is 8000km away.

Here are 'the secrets':

Initial Stage

  1. get skeleton application up running with database migration, unit test, code coverage, automated UI tests and deployment. It is not that hard, even if you haven't done it before. The key is to keep the skeleton application simple.
  2. set up BuildWise server on the integration server, running all CI steps within BuildWise. This requires understanding of CI and build language. If you read and follow my book Practical Web Test Automation, which contains instructions and the sample build scripts.
  3. implement common components such as user sign in, password reset, user management, access control, CRUD, pagination, file uploading, audit logging, etc. No matter which language you use, there are mature libraries for them. Make sure to add some automated UI tests as you go, and pass them in your build server. Discipline!
  4. add exception reporting. When an error occurs, the system will send you an email with the full stack trace.
  5. enhance the UI. Bootstrap and Font Awesome make it very easy to add progressional looks to your application.
  6. talk to the client to identify two (just two) key components must have right now. For clinical software: client management and appointments.

After 40 hours (I counted) in spare time, the first production release was out. The client could put it in use: registering new clients and booking appointments.

Ongoing

  • consult with the client to understand the business request. Use the demo server for communication proved time-saving.
  • implement the feature/enhancement or fix the bug
  • check in and kick a build in CI server (in our case, BuildWise)
  • if all tests pass, release to the demo site for the client to check
  • release to the production on a time convenient to the client (such as mid-night)

The automated tests and CI prevent numerous errors from going to the production, also enable upgrades to latest version of frameworks and libraries (some scary stories there, thanks god for automated tests!). Software releases is NOT a stressful activity. The client is getting used to new releases, "it is getting better and better". On his recommendation, several dental and physio clinics signed up with ClinicWise.

Summary

Without test automation and CI, ClinicWise is not possible. The process prevented many bugs (most from ourselves, some from dependent library and infrastructure changes), the customers only see stable and 'keep getting better' software. More importantly, the frequent release enabled us getting quick feedback to keep development and our customers happy: the software what they really want!

Here are some build server screenshots:

STARWEST Conference Slides and Videos

Posted by Zhimin Zhan on October 05, 2013|Read full article

Here are the slides for the presentation (PDF format, 5.2MB) Zhimin delivered at STARWEST.

The screencast video demos (QuickTime format) used in the presentation:

  1. Easy update test scripts using Page objects
  2. Refactoring: Extract Function refactoring
  3. Refactoring: Move to Helper
  4. Refactoring: Move
  5. Refactoring: Extract Page
  6. Refactoring: Introduce Page Object
  7. Refactoring: Rename

You might have noticed, like 97% of blogs, this web blog has not been updated for a while. It does not mean I stopped writing, instead, I consolidated ideas and experiences into books, which I think will be more helpful to readers:

And upcoming

Test Automation vital to Independent Software Vendors

Posted by on October 31, 2012|Read full article

Many experienced software programmers's dreams are to be an Independent Software Vendors (ISV), which are evidenced by the best seller book "The 4-Hour Workweek", and "Micro-ISV: From Vision to Reality".

Being an ISV, the resource is limited, most likely only you (and your loyal partner if you are lucky) are to do all, in you spare time (don't ruin your family life). Working harder is not often enough, working smarter is the key.

Months ago, My brother, a dentist and his partners opened a big dental practice. They need a medical practice system, the best quote they got was $25000. My brother told me casually that the software not stable during the trial, but no other choices. I offered: I maybe can write one for you (I never did this kind of system before). I got my first release out within a week (spare time, about 20 working hours) for feedback, and in production within one month. Now they have been using it with satisfaction for 6 months. Just last week, one fellow dentist visited my brother practice and saw the system, he showed great interest and wanted to adopt it.

How? (My brother and I located are in different countries) the secret: test automation. To get their feedback, during the peak time, I released a new version pretty much each night. The automated tests prevent me from making mistakes. Seeing is believing.

  • TestWise test case stats
  • BuildWise CI build report (28 mins with database reset, that's quite a lot of tests)
  • StoryWise requirement coverage
I have two friends who built a very nice web application. During one discussion, they shared their slight concerns on observing more competitions, which is inevitable (Web applications means global competition). I said: "Keep improving your app. Don't worry until one of your competitor discovers TestWise."