{"title":"在不执行代码的情况下检查API使用的临时模式","authors":"Erick Raelijohn, Michalis Famelis, H. Sahraoui","doi":"10.1109/FormaliSE52586.2021.00015","DOIUrl":null,"url":null,"abstract":"In theory, Application Programming Interfaces (APIs) allow developers to write client code that reuses library code without needing to know its internals. In practice, correctly using APIs requires respecting explicit and implicit constraints and usage temporal patterns. Ignoring such patterns could lead to errors and design flaws. These often cannot be detected prior to integration and system testing. We propose the Temporal Usage PAttern Checker (Tupac) for APIs, an interprocedural static analysis approach that can verify that client code conforms to temporal API usage patterns as it is being developed. We evaluated the effectiveness of our approach on 4 projects with 4 different APIs. Our evaluation shows that Tupac allows to accurately check the conformance of the client code to the patterns in under 1 second. This means that Tupac can realistically be deployed in an IDE without stalling the regular coding rhythm.","PeriodicalId":123481,"journal":{"name":"2021 IEEE/ACM 9th International Conference on Formal Methods in Software Engineering (FormaliSE)","volume":"33 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":"{\"title\":\"Checking temporal patterns of API usage without code execution\",\"authors\":\"Erick Raelijohn, Michalis Famelis, H. Sahraoui\",\"doi\":\"10.1109/FormaliSE52586.2021.00015\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"In theory, Application Programming Interfaces (APIs) allow developers to write client code that reuses library code without needing to know its internals. In practice, correctly using APIs requires respecting explicit and implicit constraints and usage temporal patterns. Ignoring such patterns could lead to errors and design flaws. These often cannot be detected prior to integration and system testing. We propose the Temporal Usage PAttern Checker (Tupac) for APIs, an interprocedural static analysis approach that can verify that client code conforms to temporal API usage patterns as it is being developed. We evaluated the effectiveness of our approach on 4 projects with 4 different APIs. Our evaluation shows that Tupac allows to accurately check the conformance of the client code to the patterns in under 1 second. This means that Tupac can realistically be deployed in an IDE without stalling the regular coding rhythm.\",\"PeriodicalId\":123481,\"journal\":{\"name\":\"2021 IEEE/ACM 9th International Conference on Formal Methods in Software Engineering (FormaliSE)\",\"volume\":\"33 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2021-05-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"1\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2021 IEEE/ACM 9th International Conference on Formal Methods in Software Engineering (FormaliSE)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/FormaliSE52586.2021.00015\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 IEEE/ACM 9th International Conference on Formal Methods in Software Engineering (FormaliSE)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/FormaliSE52586.2021.00015","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Checking temporal patterns of API usage without code execution
In theory, Application Programming Interfaces (APIs) allow developers to write client code that reuses library code without needing to know its internals. In practice, correctly using APIs requires respecting explicit and implicit constraints and usage temporal patterns. Ignoring such patterns could lead to errors and design flaws. These often cannot be detected prior to integration and system testing. We propose the Temporal Usage PAttern Checker (Tupac) for APIs, an interprocedural static analysis approach that can verify that client code conforms to temporal API usage patterns as it is being developed. We evaluated the effectiveness of our approach on 4 projects with 4 different APIs. Our evaluation shows that Tupac allows to accurately check the conformance of the client code to the patterns in under 1 second. This means that Tupac can realistically be deployed in an IDE without stalling the regular coding rhythm.