Il test metamorfico (MT) è una tecnica di test software basata su proprietà, che può essere un approccio efficace per affrontare il test dell'oracolo e il problema della generazione del caso di test. Il problema dell'oracolo del test è la difficoltà di determinare i risultati attesi dei casi di test selezionati o di determinare se i risultati effettivi concordano con i risultati previsti.

Le relazioni metamorfiche (MR) sono proprietà necessarie della funzionalità prevista del software e devono comportare esecuzioni multiple del software. Si consideri, ad esempio, un programma che implementa sen x corretto a 100 cifre significative; una relazione metamorfica per le funzioni sinusoidali è "sen (π - x) = sen x". Pertanto, anche se il valore atteso di sin x1 per il caso di test sorgente x1 = 1.234 corretto con l'accuratezza richiesta non è noto, è possibile costruire un caso di test di follow-up x2 = π - 1.234. Siamo in grado di verificare se gli output effettivi prodotti dal programma in prova dal caso di test di origine e il caso di test di follow-up sono coerenti con l'MR in questione. Qualsiasi incoerenza (dopo aver preso in considerazione gli errori di arrotondamento) indica un fallimento dell'implementazione.

Le MR non si limitano ai programmi con input numerici o relazioni di uguaglianza. Ad esempio, durante il test di un sito Web di prenotazione, una ricerca Web di alloggi a Sydney, in Australia, restituisce 1.671 risultati; i risultati di questa ricerca sono corretti e completi? Questo è un problema dell'oracolo di prova. Sulla base di una relazione metamorfica, possiamo filtrare la fascia di prezzo o la valutazione a stelle e applicare nuovamente la ricerca; dovrebbe restituire un sottoinsieme dei risultati precedenti. Una violazione di questa aspettativa sarebbe sospetta e rivelerebbe un possibile bug nel sistema.

I test metamorfici sono stati inventati da T.Y. Chen nel rapporto tecnico del 1998[1]. Da allora, più di 150 ricercatori e professionisti internazionali hanno applicato la tecnica alle applicazioni della vita reale. Alcuni esempi includono servizi web[2], computer grafica[3], sistemi integrati[4], simulazione e modellazione[5], apprendimento automatico[6], supporto decisionale[7], bioinformatica[8], componenti[9], analisi numerica[10] e compilatori[11]. Il primo importante sondaggio nel settore della MT è stato condotto nel 2016[12]. È stato seguito da un altro importante sondaggio nel 2018[13], che evidenzia le sfide e le opportunità e chiarisce i malintesi comuni.

Sebbene MT sia stato inizialmente proposto come tecnica di verifica del software, è stato successivamente sviluppato in un paradigma che copre la verifica, la convalida e altri tipi di valutazione della qualità del software[14]. MT può essere applicato in modo indipendente e può anche essere combinato con altre tecniche di analisi software statiche e dinamiche come il proving e il debug[15].

Nell'agosto 2018, Google ha acquisito GraphicsFuzz, una startup dell'Imperial College di Londra, per applicare test metamorfici ai driver di dispositivi grafici per smartphone Android[16].

Note modifica

  1. ^ T.Y. Chen, S.C. Cheung, and S.M. Yiu, "Metamorphic testing: a new approach for generating next test cases", Technical Report HKUST-CS98-01, Department of Computer Science, Hong Kong University of Science and Technology, Hong Kong (1998).
  2. ^ C. Castro-Cabrera and I. Medina-Bulo, "An approach to metamorphic testing for WS-BPEL compositions", in Proceedings of the International Conference on e-Business, IEEE (2011).
  3. ^ R. Guderlei and J. Mayer, "Towards automatic testing of imaging software by means of random and metamorphic testing", International Journal of Software Engineering and Knowledge Engineering 17 (6): 757−781 (2007).
  4. ^ T.H. Tse, S.S. Yau, W.K. Chan, H. Lu, and T.Y. Chen, "Testing context-sensitive middleware-based software applications", in Proceedings of the 28th Annual International Computer Software and Applications Conference (COMPSAC '04), vol. 1, IEEE Computer Society, pp. 458−465 (2004).
  5. ^ S. Segura, R.M. Hierons, D. Benavides, and A. Ruiz-Cortes, "Automated test data generation on the analyses of feature models: a metamorphic testing approach", in Proceedings of the 3rd International Conference on Software Testing, Verification, and Validation (ICST '10), IEEE Computer Society, pp. 35−44 (2010).
  6. ^ J. Ding, X.-H. Hu, and V. Gudivada, "A machine learning based framework for verification and validation of massive scale image data", IEEE Transactions on Big Data (2017). doi: 10.1109/TBDATA.2017.2680460.
  7. ^ F.-C. Kuo, Z.Q. Zhou, J. Ma, and G. Zhang, "Metamorphic testing of decision support systems: A case study", IET Software 4 (4): 294−301 (2010).
  8. ^ L.L. Pullum and O. Ozmen, "Early results from metamorphic testing of epidemiological models", in Proceedings of the 2012 ASE/IEEE International Conference on BioMedical Computing (BioMedCom '12), IEEE Computer Society, pp. 62−67 (2012).
  9. ^ S. Beydeda, "Self-metamorphic-testing components", in Proceedings of the 30th Annual International Computer Software and Applications Conference (COMPSAC '06), vol. 1, IEEE Computer Society, pp. 265−272 (2006).
  10. ^ C. Aruna and R.S.R. Prasad, "Metamorphic relations to improve the test accuracy of multi precision arithmetic software applications", in Proceedings of the 2014 International Conference on Advances in Computing, Communications and Informatics (ICACCI '14), IEEE (2014).
  11. ^ C. Lidbury, A. Lascu, N. Chong, and A.F. Donaldson, "Many-core compiler fuzzing", in Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '15), ACM, pp. 65−76 (2015).
  12. ^ S. Segura, G. Fraser, A.B. Sanchez, and A. Ruiz-Cortes, "A survey on metamorphic testing", IEEE Transactions on Software Engineering 42 (9}: 805-824 (2016).
  13. ^ T.Y. Chen, F.-C. Kuo, H. Liu, P.-L. Poon, D. Towey, T.H. Tse, and Z.Q. Zhou, "Metamorphic testing: A review of challenges and opportunities", ACM Computing Surveys 51 (1): 4:1-4:27 (2018).
  14. ^ Z.Q. Zhou, S. Xiang, and T.Y. Chen, "Metamorphic testing for software quality assessment: A study of search engines", IEEE Transactions on Software Engineering 42 (3): 264-28s4 (2016).
  15. ^ T.Y. Chen, T.H. Tse, and Z.Q. Zhou, "Semi-proving: an integrated method for program proving, testing, and debugging", IEEE Transactions on Software Engineering 37 (1): 109-125 (2011).
  16. ^ GraphicsFuzz acquired by Google, su imperialinnovations.co.uk. URL consultato il 20 gennaio 2020 (archiviato dall'url originale il 15 aprile 2019).

Collegamenti esterni modifica

  Portale Informatica: accedi alle voci di Wikipedia che trattano di informatica