Summary
Parasoft released WebKing 5.5, offering automatic HTTPUnit generation for functional testing of Web applications. Artima spoke with Parasoft about how this new product solves the challenges in Web application testing.
Advertisement
Parasoft released WebKing 5.5, the latest generation of its functional testing tool for Web applications. The latest release supports the automatic generation of HTTPUnit test cases by non-technical users of a Web site.
"As businesses develop increasingly complex Web applications, [following] increasingly complex business processes, more people within an organizations become responsible for approving the functionality of a Web app," says Wayne Ariola, Parasoft's vice president of corporate development.
"If a business analyst looks at the site and discovers an error, the usual process is that that analyst will grab a screen shot, describe the problem as best he can, and then send that to the developer. The developer would then have to go back into the application, try to discover the source of the error by interpreting the error description the non-technical person created," adds Ariola.
"The target for our WebKing 5.5 product is to build a liaison between someone who is not technical and the developer—the business analyst or the QA person—in order to try to discover potential functional errors with the site, and then [enable] the non-technical person to translate that error into the language that developers know well, which [in the case of WebKing] is an HTTPUnit test case."
An example of such an error might be an incorrect logoff message or the wrong balance in a banking application, says Parasoft WebKing Product Manager Nathan Jakubiak. "The business analyst or a QA person going through the application may notice that incorrect value and then, using our WebKing tool, can record the steps that led to that error. WebKing will then show each of those steps in a browser, and once you have that, the analyst can highlight the [erroneous] text, and tell WebKing what that text should have been instead. WebKing collects that information, and generates a unit test case from that information using the HTTPUnit framework. The analyst can send that over to the developer, or deposit it in a source code control or bug tracking system. The developer can run that test case to reproduce the error," and also to verify that the remedy was effective, adds Jakubiak.
"The HTTPUNit framework emulates a browser, and provides APIs for navigating through a page, submitting forms, and also defines APIs for checking response values that come back from interacting with the page. We translate everything we record into API calls in that framework that allows WebKing to replicate what the user recorded... Therefore, WebKing is looking at the actual code—the HTML, the CSS, the JavaScript. [It] parses that code, and looks for patterns in that code. [In testing for] functional messages, WebKing looks for elements in the HTML. So it's looking at the code level, not at the GUI level."
In addition to automating functional testing, WebKing can also be useful in test-driven style development of Web applications. Jakubiak notes that test-first development of Web applications is "somewhat unique because in order to see how something works, you often have to have that feature to some extent implemented, you need that on a server somewhere [so] you actually see what's happening. But you can define [in advance of writing code] what your requirements are, and as you write [the code], validate that you're following that."
Parasoft's Ariola notes that although test-first Web application development is challenging, errors should still be prevented, rather than simply discovered and fixed once they occur. "We promote a process ... called automated error prevention. We try to discover the class of errors and understand the earliest point that that class of errors can be injected into the actual product. Then we automate the practice of discovering that [error class], and try to prevent the error at the point where it can be injected."
On example of that automatic error prevention is testing a template that produces a Web page, in addition to performing functional testing on the page itself. "The template associated with the site itself can often be [tested] statically. Take the example of branding. Your specifications can say that three links on the bottom of the page must there. We can check both the page and template to see if those [links] are actually there. Or your specs can state that the navigation menus have the correct background color. WebKing allows you to create those rules, and then you can automate [checking] that. You can test the Web app as you develop it or, if you already have a Web application, you can tell Web King to spider the site and find all those errors."