An Incremental Approach to Testing AOP

  • André RestivoEmail author
  • Ademar Aguiar
  • Ana Moreira
Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 743)


Breaking down applications into smaller modules is a common way for software developers to cope with the increasing complexity of their projects. A common barrier to this endeavor is the presence of crosscutting concerns that prevent reusability and reduce comprehensibility. The promise of AOP (Aspect-Oriented Programming) is that, by using it, developers will be able to organize these crosscutting concerns into their own units of modularity. However, AOP does not tackle the problem of having tangled automatic tests. This paper presents a technique using incremental testing and invasive aspects to modify and adapt tests, enabling the development of unit tests that are free of crosscutting concerns and thus easier to reuse. Using a medium scale project, we will show that without using this technique, due to the presence of invasive aspects, some unit tests would have to be discarded or modified to accommodate the changes made by them.



We would like to thank FCT for the support provided through scholarship SFRH/BD/32730/2006.


  1. 1.
    Assunção, W.K.G., Colanzi, T.E., Vergilio, S.R., Pozo, A.T.R.: Evaluating different strategies for integration testing of aspect-oriented programs. J. Braz. Comput. Soc. 20(1), 9 (2014). doi: 10.1186/1678-4804-20-9CrossRefGoogle Scholar
  2. 2.
    Balzarotti, D., Monga, M.: Using program slicing to analyze aspect-oriented composition. In: Proceedings of Foundations of Aspect-Oriented Languages Workshop at AOSD (2004)Google Scholar
  3. 3.
    Baniassad, E., Clarke, S.: Finding aspects in requirements with theme/doc. In: Tekinerdou gan, B., Moreira, A., Araújo, J., Clements, P. (eds.) Proceedings of Early Aspects 2004 Workshop, March 2004Google Scholar
  4. 4.
    Ceccato, M., Tonella, P., Ricca, F.: Is AOP code easier to test than OOP code? In: Workshop on Testing Aspect-Oriented Programs, International Conference on Aspect-Oriented Software Development, Chicago, Illinois, March 2005Google Scholar
  5. 5.
    Eclipse Foundation: The eclipse foundation open source community website, December 2010.
  6. 6.
    Fowler, M.: Mocks aren’t stubs (2007).
  7. 7.
    Greenwood, P., Garcia, A.F., Bartolomei, T., Soares, S., Borba, P., Rashid, A.: On the design of an end-to-end aosd testbed for software stability. In: Proceedings of the 1st International Workshop on Assessment of Aspect-Oriented Technologies (ASAT 2007), Vancouver, Canada, Citeseer (2007)Google Scholar
  8. 8.
    Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., Irwin, J.: Aspect-oriented programming. In: Akşit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997). doi: 10.1007/BFb0053381CrossRefGoogle Scholar
  9. 9.
    Havinga, W., Nagy, I., Bergmans, L., Aksit, M.: A graph-based approach to modeling and detecting composition conflicts related to introductions. In: AOSD 2007: Proceedings of the 6th International Conference on Aspect-Oriented Software Development, pp. 85–95. ACM Press, New York (2007)Google Scholar
  10. 10.
    Katz, S., Israel, H.: Diagnosis of harmful aspects using regression verification. In: FOAL: Foundations of Aspect-Oriented Languages, pp. 1–6 (2004)Google Scholar
  11. 11.
    Kienzle, J., Yu, Y., Xiong, J.: On composition and reuse of aspects. In: Software Engineering Properties of Languages for Aspect Technologies (2003)Google Scholar
  12. 12.
    Lagaisse, B., Joosen, W., De Win, B.: Managing semantic interference with aspect integration contracts. In: Software Engineering Properties of Languages and Aspect Technologies (2004)Google Scholar
  13. 13.
    Marin, M., Moonen, L., van Deursen, A.: An integrated crosscutting concern migration strategy and its application to jhotdraw. Technical report., Delft University of Technology Software Engineering Research Group (2007)Google Scholar
  14. 14.
    Tarr, P., Ossher, H., Harrison, W., Sutton, J.S.M.: N degrees of separation: multi-dimensional separation of concerns. In: Proceedings of the 21st International Conference on Software Engineering, ICSE 1999 (1999)Google Scholar
  15. 15.
    Rashid, A., Moreira, A., Araújo, J.: Modularization and composition of aspectual requirements. In: Proceeding 2nd International Conference on Aspect-Oriented Software Development (AOSD 2003) (2003)Google Scholar
  16. 16.
    Restivo, A., Aguiar, A., Moreira, A.: Incremental modular testing for AOP. In: Proceedings of the 11th International Joint Conference on Software Technologies (ICSOFT 2016): ICSOFT-PT. Lisbon, Portugal, 24–26 July 2016, vol. 2, pp. 50–59 (2016).
  17. 17.
    Restivo, A.: DrUID: Unexpected interactions detection (2009).
  18. 18.
    Restivo, A.: Aida: Automatic interference detection for aspectj (2010).
  19. 19.
    Restivo, A.: School-aspectj-testbed (2014).
  20. 20.
    Restivo, A., Aguiar, A.: Disciplined composition of aspects using tests. In: Proceedings of the 2008 AOSD Workshop on Linking Aspect Technology and Evolution, LATE 2008, New York, USA, pp. 8:1–8:5 (2008).
  21. 21.
    Restivo, A., Aguiar, A.: DrUID – unexpected interactions detection. In: Demonstration at the Aspect Oriented Software Development Conference (AOSD 2009) (2009)Google Scholar
  22. 22.
    Silveira, F.F., da Cunha, A.M., Lisbôa, M.L.: A state-based testing method for detecting aspect composition faults. In: Murgante, B., et al. (eds.) ICCSA 2014. LNCS, vol. 8583, pp. 418–433. Springer, Cham (2014). doi: 10.1007/978-3-319-09156-3_30CrossRefGoogle Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  1. 1.Faculdade de Engenharia da Universidade do PortoPortoPortugal
  2. 2.Faculdade de Ciências e TecnologiaUniversidade Nova de LisboaLisbonPortugal

Personalised recommendations