Dissertação para obtenção do Grau de Mestre em
Engenharia InformáticaIn an object-oriented setting, objects are modeled by their state and operations. The
programmer should be aware of how each operation implicitly changes the state of an
object. This is due to the fact that in certain states some operations might not be available, e.g., reading from a file when it is closed. Additional care must be taken if we consider aliasing, since many references to the same object might be held and manipulated. This hinders the ability to identify the source of a modification to an object, thus making it harder to track down its state. These difficulties increase in a concurrent setting, due to the unpredictability of the behavior of concurrent programs.
Concurrent programs are complex and very hard to reason about and debug. Some of
the errors that arise in concurrent programs are due to simultaneous accesses to shared
memory by different threads, resulting in unpredictable outcomes due to the possible
execution interleavings. This kind of errors are generally known as race conditions.
Software verification and specification are important in software design and implementation as they provide early error detection, and can check conformity to a given specification, ensuring some intended correctness properties. To this end, our work
builds on the work of Spatial-Behavioral types formalism providing object ownership
support. Our approach consists in the integration of a behavioral type system, developed for a core fragment of the Java programming language, in the standard Java development process.PTDC/EIA-CCO/104583/2008 research scholarshi