This invention relates generally to the field of web services and, more specifically, to a configurable web services system and a method to detect defects in software applications.
Web applications are ubiquitous in today's processing world. Java is a popular choice for implementing the backbone [or significant portions] of many software applications, but typical web applications are heterogeneous systems integrating a variety of languages and technologies, including: HTML, JavaScript, PHP, Perl, and MySql.
Testing techniques are insufficient in many regards, including their inability to catch difficult corner-case bugs. This problem is more troublesome as the complexity of the software system increases. Thus, formal validation techniques are required, especially when validating complex software systems and/or when checking safety or security critical aspects of systems.
There is a large body of work on formal software validation technologies and even some recent work on applying some of them to Java-based systems. However, there is no end-to-end solution for large heterogeneous systems such as web applications. Point tools, whenever available, are too general to work well for web applications. Their usage and formalisms are too difficult to comprehend for the average system engineer and, further, their application is not sufficiently automated and too ad hoc to be easily repeatable: much less standardized.
Therefore, the ability to solve these significant validation problems in web services creates an interesting challenge. As with all such processing operations, of critical importance are issues relating to speed, accuracy, and automation.
The present invention provides a method and a system for providing a configurable web services system and a method to detect defects in software applications that substantially eliminates or reduces at least some of the disadvantages and problems associated with previous methods and systems.
In accordance with a particular embodiment of the present invention, a method is offered that includes detecting one or more defects in a software application composed of heterogeneous languages using a configurable web services architecture. The detecting step further includes: capturing use cases associated with the software application and checking their validity; providing an automatic invocation of property monitors for model checking; and visualizing one or more defects in the software application for diagnosis.
The detecting can further include transforming a heterogeneous software application into a homogeneous application. In more specific embodiments, the detecting further includes providing an automatic test generation for a presentation layer associated with the software application. The configuration associated with the software application can be a simple properties file. The detecting further includes simulating user behavior and generating drivers to test business logic from the use cases or scenarios.
In still other embodiments, the detecting includes replacing a database by empty or user-supplied stubs. The detecting can further include verifying business logic for the software application.
Technical advantages of particular embodiments of the present invention include enabling rapid customization and increased automation for validation of large software code bases [based on the domain-specificity of the software application]. For example, the web application could be a financial application requiring security properties to be validated. In addition, the configuration will be customized to achieve maximum automation in performing such validation. The configuration can be specified using a properties file (e.g., XML).
The present invention can also offer an end-to-end solution for formally validating enterprise-strength web applications. Moreover, it offers a choice of an appropriate set of technologies well suited to the nature of such applications. It may further provide customization of the toolset to web applications to maximize efficacy of the toolset on this class of Java applications. For example, this could include the specific choice and composition of property templates and use of a string manipulation library in symbolic execution. It also offers flexibility in capturing requirements either in a simple specification language or using a visual formalism such as UML.
Other technical advantages will be readily apparent to one skilled in the art from the following figures, descriptions, and claims. Moreover, while specific advantages have been enumerated above, various embodiments may include all, some or none of the enumerated advantages.
For a more complete understanding of particular embodiments of the invention and their advantages, reference is now made to the following descriptions, taken in conjunction with the accompanying drawings, in which:
The embodiment of
The architecture presented in
In essence, the present invention relates to top-level methodologies in software defect detection. A target architecture is usually published in white papers of products from companies and, therefore, it is easy to identify similarities with SAVE.
The objective [in the endeavors outlined herein] is to reduce failure costs by innovative software quality. Failures in this arena include: 1) application software flaws causing financial disasters; 2) embedded systems: automotive software defects cause stalling; 3) e-Commerce web sites hacked or go down. Of similar significance is the expense in fixing these issues. Rough estimates for the cost of fixing a bug in the field is approximately $30,000 vs. $5000 for fixing a bug during coding/development. Thus, the mission is to develop innovative techniques to intelligently evaluate software. Specifically, the goal is to identify defects during software development with 100% coverage, which is not achievable with conventional testing techniques.
Such an architecture has numerous advantages, including enabling rapid customization and increased automation for validation of large software code bases, based on the domain-specificity of the software application. For example, the web application could be a financial application requiring security properties to be validated. In addition, the configuration can be customized to achieve maximum automation in performing such validation. In one embodiment, the configuration can be specified using a properties file in XML.
The tendered system can also offer a viable end-to-end solution for formally validating enterprise-strength web applications. Moreover, it offers a choice of an appropriate set of technologies well suited to the nature of such applications. It may further provide customization of the toolset to web applications to maximize efficacy of the toolset on this class of Java applications. This could apply to the specific choice and composition of property templates, the use of a string manipulation library in symbolic execution, etc. There is flexibility in capturing requirements either in a simple specification language or using a visual formalism such as UML.
Inherently, the proposed system offers an emphasis on automation and a simple user-friendly interface to enhance usability of the toolset for the average system engineer. For example, the use of property templates transforms the often complicated and error prone task of specifying requirements, to a few clicks on a pull-down menu and minimal completion of some forms (form filling). There is a symbiotic interaction of various constituent tools to enhance the overall power of each step in the validation process. This could include static analysis based on symbolic execution used to enhance environment generation. This could also include property templates being used to automatically specify and verify more expressive properties with symbolic execution based model checking.
At a subsequent step, the database is replaced (stubbed out). In this case, the EJB/server/database calls are automatically replaced by empty or user-supplied stubs.
Before turning to
In terms of the requirements validated:
In terms of the defects detected:
The identification of these defects in this example reflects the importance of proper validation. Without a tool, such as that offered by the present invention, the PetStore model would continuously falter or fail each time the defect is encountered.
The global system aspect of the present invention can, first, classify properties/requirements into a small number of categories based on the domain of the software application (such as e-commerce, financial, etc.). This classification can be done a priori for each domain. It also scans the source code of the Java application and creates a set of interesting events that the user can choose from when specifying his requirements. A set of specific requirements/properties [that need to be satisfied] is then matched with the categories. After a successful match, monitors/property checkers are invoked corresponding to the instantiated property category.
Formal validation techniques for software are problematic. For example, point tools (e.g., model checkers) for (pure) Java are difficult to apply stand-alone; formalisms and are usage difficult to master for an average system engineer; and there is no customization for web applications.
Formal properties/requirements described in a mathematical language (called LTL [linear temporal logic]) are non-intuitive and complicated and, further, designers need an easier way to specify this (especially GUI-based systems). Furthermore, what is needed is a methodology to detect interesting “events” for an application. These events can then be used to populate properties. Thus, there is a need to increase the usability of a formal verification methodology for web applications.
In terms of property classification/templates, model checking requirements in JPF requires two steps: expressing the property precisely in a temporal logic (e.g. CTL, LTL); and coding a Java monitor implementing property that executes along with JPF and checks. Property templates automate these steps in the context of web applications. Here, the user chooses from a small list of templates, which are designed to capture most of the commonly checked requirements for web applications. For example, about fifty pages of requirement documents are reduced to about ten generalized templates.
The user then enters a few parameters into this template based on the specific application and property to be checked and, subsequently, invokes model checking in SAVE (e.g., to check the selected property: “The shopping cart is emptied after checkout in every shopping session.”). Steps may include: 1) choose the response property template in SAVE: Event b follows a; 2) form-fill the events “cartempty” and “checkout” corresponding to a and b respectively; and 3) invoke model checking in SAVE.
The advantages of property templates include the ease of specification and, furthermore, it is easy to match a natural language requirement to one among a small list of templates. In addition, there is no need to write a precise mathematical language property. The list of templates can serve as a guide in assembling the set of requirements to validate. There is also an ease of model checking.
In regards to automatic monitor generation, monitors corresponding to property templates are developed a priori. Using domain-specific automated static analysis, program objects/events (corresponding to the relations present in the property specification) are effectively found. A suitable property template is then instantiated with the program objects/events. The monitor corresponding to the template is invoked with appropriate instantiations. The software application to be validated is then run with the monitor watching the execution. Collectively, these actions achieve a viable approach for software validation.
It is critical to note that the components illustrated in
While the present invention has been described in detail with specific components being identified, various changes and modifications may be suggested to one skilled in the art and, further, it is intended that the present invention encompass any such changes and modifications as clearly falling within the scope of the appended claims.
Note also that, with respect to specific process flows disclosed, any steps discussed within the flows may be modified, augmented, or omitted without departing from the scope of the invention. Additionally, steps may be performed in any suitable order, or concurrently, without departing from the scope of the invention.
Numerous other changes, substitutions, variations, alterations, and modifications may be ascertained to one skilled in the art and it is intended that the present invention encompass all such changes, substitutions, variations, alterations, and modifications as falling within the scope of the appended claims.