Software testing is a process designed to make sure computer code does what it is designed to do and that it doesn’t do anything unintended. It is used to achieve quality assurance, verification, validation and reliability estimation. It is a major quality control measure used during the software development. Testing is the process of operating a system or component under specified conditions, observing or recording the results, and making an evaluation of some aspect of system or a component.Testing of software is done at different levels of abstraction - unit, integration and system levels. During testing of software, there is a need to observe the internal and external execution details of the software. The internal execution details are required for the diagnosis of incorrect output during testing, and to ensure correctness of processing in case of a correct output. Without observing the internal execution details, the incorrect results may appear to be correct.
Logging is a systematic method of recording the internal information of software. It is one of the typical examples of crosscutting concern (concerns that are common to many of the core modules that span multiple modules). By examining the log, an unexpected system behavior can be identified and corrected. It acts as a diagnostic assistant to reveal the inner working of a system. Logging is also used for different purposes like debugging, testing, auditing, performance monitoring, code profiling, etc.
Besides logging, the theory of random phenomena has always had widespread appeal not least because of its application to games of chance and speculation. The fundamental notion is that of the expected value of a bet. The Monte Carlo method computes this expected value by simulating a large number of scenarios and averaging the observed payoff of the bet over all scenarios. The simulation of the scenarios is best performed by a computer program. Computational power is becoming cheap and programming languages more powerful and more elegant. Object orientation in particular represents a significant advance over procedural programming. Aspect-oriented programming (AOP) is a new programming paradigm [35]. It is popular for the use of modularizing concerns that that cross-cut the basic functionality of a program like logging. AOP has provided a new mechanism for encapsulating crosscutting concern in a module unit call aspect. The advantages of simulation techniques using AOP is discussed.
Inhaltsverzeichnis (Table of Contents)
- CHAPTER 1: Introduction
- 1.1 Introduction
- 1.2 Preliminary
- 1.2.1 Logging with AOP
- 1.2.3 Observability using AOP
- 1.2.4 Simulation using AOP
- 1.2.5 Aspect-based Testing Technique
- 1.2.6 Aspect Log - AutotraceAspect
- 1.2.7 Aspect execution
- 1.2.8 Logging Output
- 1.2.9 Test Coverage
- CHAPTER 2: Aspect-Oriented Software
- 2.1 Object-Oriented Paradigm
- 2.2 Aspect-Oriented Paradigm
- 2.3 Weaving with AOP
- 2.4 Crosscutting concerns with AOP
- 2.5 Comparison of OOP and AOP
- 2.6 Advantage of using AOP
- 2.7 Implementation of AOP
- CHAPTER 3: AspectJ
- 3.1 Introducing AspectJ
- 3.2 Dynamic Crosscutting Constructs
- 3.2.1 Join Point
- 3.2.2 Pointcut
- 3.2.3 Kinded Pointcuts
- 3.2.4 Non-kinded Pointcuts
- 3.2.5 Advice
- 3.2.6 Aspects
- 3.3 Static Crosscutting Constructs
- CHAPTER 4: An Overview of Logging with AOP
- 4.1 Overview
- 4.2 Logging with Java
- 4.2.1 Apache Log4j
- 4.2.2 Java Logging API
- 4.2.3 An example of Logging using Java API and Log4j
- 4.3 Logging for Observability of software
- 4.4 Logging with AOP
- 4.3.1 Testing
- 4.3.2 Exception Handling
- 4.3.3 Tracing
- 4.3.4 Code Profiling
- CHAPTER 5: Testing of Loop Join Points Using AspectJ
- 5.1 Overview
- 5.2 Unit testing
- 5.2.1 Unit testing using aspects
- 5.3 Loop Join Points
- 5.4 Aspect for Join Point
- 5.4.1 Checking Preconditions and Postconditions
- 5.4.2 Tracing Loop Joinpoint
- 5.4.3 Code Coverage
- CHAPTER 6: Observability and Logging using AOP
- 6.1 Overview
- 6.2 Use of Aspect for Increasing Observability
- 6.3 Aspect-based Testing Technique
- 6.4 Aspect Log - AutotraceAspect
- 6.4.1 Methods in Aspect
- 6.4.2 Logging aspect
- 6.5 Aspect execution
- 6.6 Output Report
- 6.6.1 Level of Testing
- 6.6.2 Unit Testing
- 6.6.3 Integration Testing
- 6.6.4 System Testing
- 6.6.5 Inheritance Property
- 6.6.6 Dynamic Binding
- 6.6.7 Test Coverage
- CHAPTER 7: Simulation with AOP
- 7.1 Random Variable
- 7.2 Stochastic process
- 7.2.1 Poisson Process
- 7.2.2 Markov Chains
- 7.2.3 Brownian Motion
- 7.3 Distribution Models
- 7.4 Monte Carlo Method
Zielsetzung und Themenschwerpunkte (Objectives and Key Themes)
This book aims to provide a comprehensive exploration of logging and simulation within the context of Aspect-Oriented Programming (AOP). It delves into the fundamental concepts of AOP, emphasizing its role in addressing crosscutting concerns.- Aspect-Oriented Programming (AOP) and its application in software development.
- The use of AOP for logging and observability in software systems.
- Aspect-based testing techniques and their implementation using AspectJ.
- Simulation with AOP, including the application of stochastic processes and Monte Carlo methods.
- Practical examples and illustrations of AOP principles using AspectJ.
Zusammenfassung der Kapitel (Chapter Summaries)
- Chapter 1 introduces the concept of logging and simulation within the framework of AOP. It provides a basic overview of AOP, its benefits, and its application in various software development scenarios. The chapter also delves into the importance of logging for observability, testing, and debugging software systems.
- Chapter 2 delves into the foundations of AOP, contrasting it with the Object-Oriented Programming (OOP) paradigm. It explores key concepts like crosscutting concerns, weaving, and the advantages of using AOP. The chapter further discusses different implementations of AOP, laying the groundwork for subsequent chapters.
- Chapter 3 focuses on AspectJ, a popular AOP framework, introducing its core concepts and constructs. It covers dynamic crosscutting constructs like join points, pointcuts, advice, and aspects, providing a practical understanding of how these elements work together. The chapter also explores static crosscutting constructs, providing a comprehensive understanding of the AspectJ framework.
- Chapter 4 provides a detailed overview of logging within the AOP paradigm. It discusses various logging techniques, including Apache Log4j and the Java Logging API, and demonstrates how AOP can enhance logging capabilities for observability, testing, and exception handling.
- Chapter 5 focuses on testing using AOP, particularly for loop join points. It explores unit testing within an AOP context and discusses how aspects can be used to define preconditions, postconditions, and tracing for loop join points.
- Chapter 6 delves into the use of AOP for enhancing observability and logging. It introduces Aspect Log, an aspect-based approach for tracing program execution and generating detailed logs, It further explores various levels of testing, including unit, integration, and system testing, highlighting the benefits of AOP for improving code coverage.
- Chapter 7 explores the application of AOP in simulation. It introduces concepts like random variables, stochastic processes, distribution models, and the Monte Carlo method, demonstrating how these concepts can be implemented using AOP for creating sophisticated simulation models.
Schlüsselwörter (Keywords)
The book focuses on key concepts such as Aspect-Oriented Programming (AOP), logging, observability, simulation, AspectJ, join points, pointcuts, advice, aspects, unit testing, integration testing, system testing, code coverage, random variables, stochastic processes, distribution models, and the Monte Carlo method.- Citation du texte
- Mutum Meetei (Auteur), 2014, Logging and Simulation using Aspect Oriented Software, Munich, GRIN Verlag, https://www.grin.com/document/285596