next up previous contents
Next: Comparisons Up: Java Uniform Document Environment Previous: Workgroup   Contents

Subsections


Quality of Jude Applications

This chapter analyzes effects of Jude Aplications development process on software quality of final Jude Aplications and suggests some improvements according theoretical and practical considerations.

Introduction

Jude is a rapid application development tool. The applications are called Jude-Applications. The applications must be easy to maintain for developers. As pointed out by [Meyer 1997]:

``We all want our software systems to be fast, reliable, easy to use, readable, modular, structured and so on. But these adjectives describe two different sort of qualities. On one side we are considering such qualities as speed or ease of use, whose presence or absence in a software product may be detected by its users. These properties may be called external quality factors. Other qualities applicable to a software product, such as being modular, or readable, are internal factors, perceptible only to computer professionals who have access to the actual software text. In the end, only external factors matter. If I use a Web browser or live near a computer-controlled nuclear plant, little do I care whether the source program is readable or modular if graphics take ages to load, or if a wrong input blows up the plant. But the key to achieving these external factors is in the internal ones: for the users to enjoy the visible qualities, the designers and implementers must have applied internal techniques that will ensure hidden qualities.''
So Jude must follow principles based on internal quality factors in order to produce Jude-Applications having external quality factors.

In Jude there are two completely different worlds interacting together: knowledge-base on the server side and agents on the client side. The two worlds adopts also two different implementation paradigms: declarative for knowledge-base and imperative for Jude-Agents. Section [*] and [*] point out all the benefit of the two paradigms and of their relationships. This chapter will enter in more details in order to discover benefits and possible improvements of Jude development tool. In particular every external quality factor listed by [Meyer 1997] is taken in consideration.

Correctness

``Correctness is the ability of software products to perform their exact tasks, as defined by their specification.''[Meyer 1997]
The high-level, knowledge-base approach of Jude is less error-prone than others low-level formalisms because the produced code is near to the application domain, there are less instructions to specify and they are loosely coupled.

However SimpleLogic lacks many useful features in order to achieve correctness at compile time. In particular SimpleLogic is not safebecause no extensive type checking is performed by the compiler. ``Many studies have found that the cost of correcting an error grows astronomically when the time of detection is delayed. Static typing, which enables the early detection of type errors, is a fundamental tool in the quest for reliability.'' [Meyer 1997]. I have directly experimented the bad effects of lack of this feature because I have spent a lot of time debugging mere type errors occurring at run-time rather than at compile-time.

Generic type is is a type ``having formal parameters representing types. Such a class (type) will yield a type only through generic derivation.''[Meyer 1997] Generic derivation is ``the process of providing a type for each formal generic parameter of a generic class, yielding a type as a result.''[Meyer 1997]Generic mechanism are useful in order to ensure statically checkable type safety, but they are not implemented in SimpleLogic.

XSB uses tables mechanism that in many cases avoid infinite loops typical of Prolog inference-engines . However there are cases where this problem occurs, in particular using rules working on infinite types as number, list etc. Probably the best solution is to use another more elegant logical language. There are logical languages as Datalog, HOL, Isabelle, Oz etc. having a better semantics and better inference engines than Prolog.

The usage of a DBMS avoids one of the most insidious source of errors: concurrent programming, as noted by [Fowler 1997]:

``We need to consider concurrency issues. It is interesting that information system applications probably use more concurrency than any other style of software yet worry about it least. This is due to the powerful transaction model that is usually handled very well by a database, freeing the application programmer from most concurrency headaches.''
The agent based framework permits the division of a big application into smaller and more manageable agents. Already tested and debugged agents can also be reused in other applications.

Robustness

``Robustness is the ability of software systems to react appropriately to abnormal conditions.''[Meyer 1997]
Up to date this aspect is not directly take in account. The only partial adopted solution is the set bad_object containing all the objects violating some constraints.

Extendibility

``Extendibility is the ease of adapting software products to changes of specification.''[Meyer 1997]
A declarative knowledge base is more understable and less error-prone than a imperative code because it is more decomposable in to small pieces which a human reader can understand without having to know the others, or, at worst, by having to examine only a few of the others. In other words when you change a part of procedural code sometimes you broken implicit contracts with other parts of the system. On the contrary the change of a declarative statement affects in a more predictable way other statements.

Transaction-Logic can also be used to convert base facts related to an old knowledge-base schema to the new knowledge-base schema.

The usage of compound-document framework permits developers to extend the functionality of the entire system simply adding others viewers and editors. Maintain a large set of little viewers and editors is obviously easier than maintain a equivalent big and complex stand-alone application.

A source of problem is the lack of separate name spaces for each cluster. So every time you declare a relation you must choose a unique name for the entire knowledge-base in order to avoid conflicts. The consequence is the use of strange names for some relations in order to avoid conflicts with relations of other clusters. This compromises both extendibility and readability.

There is not a support for compound clusters. A cluster is a file. A compound cluster should be a directory. Each cluster (normal or compound) that stays inside this directory should be a sub cluster of the given compound cluster. This is an organization similar to Eiffel clusters and Java packages.

Re-usability

``Reusability is the ability of software elements to serve for the construction of many different applications.''[Meyer 1997]
In [Meyer 1997] there is a deep study of the advantage of resusability of object-oriented software against classic procedural code. SimpleLogic combines this benefits with the power and simplicity of a declarative programming language.

The compound-document paradigm favors reuse of viewers and editors.

Compatibility

``Compatibility is the ease of combining software elements with others.''[Meyer 1997]
In general knowledge-base specification, thanks to its powerful semantic, can be a way to merge different source of information, as noted in [Uschold 1996]:

''We observe that disparate backgrounds, languages, tools, and techniques are a major barrier to effective communication among people, organizations, and/or software systems. We show how the development and implementation of an explicit account of a shared understanding (i.e. an `ontology') in a given subject area, can improve such communication, which in turn, can give rise to greater reuse and sharing, inter-operability, and more reliable software.''
If you do not want to spend time into converting old data into SimpleLogic format you can also use Jude as a document management tools, as described in section [*].

Efficiency

``Efficiency is the ability of a software system to place as few demands as possible on hardware resources, such as processor time, space occupied in internal and external memories, bandwidth used in communication devices.''[Meyer 1997]
Clearly a dedicated application can run faster than an application written under a general framework as Jude. However if the framework is used in many applications then it can be optimized and improved in a cost effective manner contrary to a dedicated application because the cost and the effort is distributed on all applications.

A declarative piece of code as the knowledge-base specification is better suited for automatic compiler optimization than an imperative piece of code.

Portability

``Portability is the ease of transferring software products to various hardware and software environments.''[Meyer 1997]
Java is used on the client side. It is designed in order to be portable to different operating systems and hardware platforms.

Ease-of-use

``Ease-of-use is the ease with which people of various backgrounds and qualifications can learn to use software products and apply them to solve problems. It also covers the ease of installation, operation and monitoring.''[Meyer 1997]
The installation process is simplified by the use of Java technology. Every time you update the client-side of the program (adding another viewer or another editor, correcting some bugs, improving performances of some module) the client receives the new version.

A quotation from a Sun document [Sun1996] says:

``Sun Microsystems set out to develop a low cost, low administration network access desktop which coupled the centralized maintenance and administration benefits of the mainframe with the flexibility of client/server. In doing so, Sun has developed a network computer called the Java Desktop.[...]

Enabled by Sun's Java platform the Java Desktop is a stateless desktop device: everything that constitutes 'state': operating system applications, data, integrity, etc. has been relocated from the client (where it resides in the fat client world) to the server. Moving state to central server machines and deploying stateless Java Desktops in the dealing room offers the benefits of centralized computing, such as: (*) centralized IT management; (*) low cost, eminently replaceable desktops; (*) instantly updated applications to all network computers (eliminating versioning problems) (*) low desktop management cost; (*) scalability, allowing a relatively high ratio of network computers per server; (*) elimination of local administration of configuration files''
Now Jude is launched through an applet. Every time all the code must be load from the server. WebStart is a new Sun application installation tool that can be used to resolve this problem. It caches on the local machine all the class of a Java application, increasing the startup time contrary to a classic Applet application. This feature preserve also the low maintenance cost associated to a Java application because when the code on the server changes, the local machine is updated automatically.

Further details concerning Jude-Applications user interfaces ease of use are presents in chapter [*]

Functionality

``Functionality if the extent of possibilities provided by a system.''[Meyer 1997]
The shared knowledge-base is at the base of functionalities of Jude-Agents.

Timeliness

``Timeliness is the ability of a software system to be released when or before its users want it.''[Meyer 1997]
If the framework works well you are saving a lots of time. If you spend time improving the framework then all the applications build on it will receive benefits.

Verifiability

``Verifiability is the ease of preparing acceptance procedures, especially test data, and procedures for detecting failures and tracing them to errors during the validation and operation phases.''[Meyer 1997]
With a formal specified knowledge base you can apply automatic reasoning methods to verify the correctness of theorems etc.

The imperative Java source code contains also a first tentative to include contracts, according to Design by Contract as described in [Meyer 1997].

I have used also JUnit tool in order to perform some simple regression tests every time the code is changed.

Integrity

``Integrity is the ability of software systems to protect their various components (program, data) against unauthorized access and modification.''[Meyer 1997]
See section [*] for informations about security mechanisms.

The update of knowledge-base is based on a log-file, that permits recovering of database changes.


Reparaibility

``Reparaibility is the ability to facilitate the repair of defects.''[Meyer 1997]
Jude does not provide a debugging tools for SimpleLogic specifications. A good tool that should be ported to Jude is Explain. It is a module of Datalog deductive database Coral that permits users to view all the applied rules during a fact assertion. As described in [Arora]:

``Programs in deductive database and programming systems have a natural meaning that is based upon their mathematical reading as logical rules. High-level `explanations' of a program evaluation/execution can be constructed to provide added functionality: (1) To debug a program by following a chain of deductions leading to an unexpected (and possibly incorrect) conclusion; (2) To follow the derivation of certain correct conclusions to determine why and how they are reached; (3) To identify consequences of a (typically, incorrect or unexpected) fact. This functionality can be utilized either to perform post-mortem analysis of a session, or to interactively develop programs by running queries and viewing their deductions simultaneously. `Explanations' of programs are especially important in the context of deductive databases for three reasons: (1) These programs could involve recursion, and hence, the chain of inferences is often not evident. (2) When the input data set is large, it is very difficult for a user to inspect the data and determine which facts lead to which answers, and exactly how.[..] The design is based on the representation of a program evaluation as a set of derivation trees, and the facility provides a high-level explanation of the inferences carried out during program execution. [...] Explain is very useful in identifying the source of error when a program produces an unexpected result. The erroneous result could be caused by a poorly written set of rules, or bad data in the database. Explain allows the user to examine all the rule instantiations, organized into derivation trees, that contributed to the creation of the result fact.''''

Economy

``Economy the companion of timeliness, is the ability of a system to be completed on or below its assigned budget.''[Meyer 1997]
Every time you use a framework that works for you, you are saving a lots of time.

Conclusion

From a theoretical point of view writing programs using Jude should require less time than using traditional programming environments. In practice this is not always true, because traditional languages are more mature, they have a lots of features, a lots of tools, so their usage is very productive.

In order to achieve all the advantages of declarative programming paradigm contrary to imperative one, Jude must be improved following the proposed enhancements.


next up previous contents
Next: Comparisons Up: Java Uniform Document Environment Previous: Workgroup   Contents
Massimo Zaniboni 2001-03-10