ABSTRACT
Desenvolvido pelo Facebook em 2012, o GraphQL tem se tornado uma alternativa popular para os desenvolvedores na construção de suas APIs Web. Sua principal característica é retornar apenas os dados solicitados pelo cliente da API, evitando o tráfego e processamento desnecessários, o que torna as APIs GraphQL flexíveis às necessidades dos clientes. Essas características levaram a uma adoção crescente do GraphQL na construção de APIs Web. Porém, à medida que seu uso cresce, torna-se ainda mais importante garantir a confiabilidade dos softwares em produção, evitando erros de inconsistência de dados, validação de campos ou simples erros que possam ter passado despercebidos durante o desenvolvimento do software. Nesse contexto, este trabalho tem como objetivo explorar a geração aleatória e automática de consultas válidas para testar APIs GraphQL, visando auxiliar na criação de casos de teste e reduzir a necessidade de trabalho humano dispensável na geração desses casos, ao mesmo tempo em que possibilita aumentar a confiabilidade das APIs GraphQL. Utilizando a linguagem de programação funcional Haskell e a biblioteca QuickCheck, este trabalho busca auxiliar no desenvolvimento de casos de teste, assim contribuindo na confiabilidade dos sistemas desenvolvidos que utilizam a tecnologia GraphQL. A abordagem utilizada neste trabalho mostrou-se promissora, pois permitiu a geração de milhares de consultas bem tipadas de acordo com a especificação do esquema, as quais foram consideradas válidas por um sistema de validação.
- GraphQL 2023. GraphQL. GraphQL. https://graphql.orgGoogle Scholar
- GraphQL 2023. GraphQL Foundation. GraphQL. https://graphql.org/foundation/Google Scholar
- GraphQL 2023. GraphQL Spec. GraphQL. https://spec.graphql.org/draftGoogle Scholar
- GraphQL 2023. Schemas and Types. GraphQL. https://graphql.org/learn/schema/#type-systemGoogle Scholar
- Asma Belhadi, Man Zhang, and Andrea Arcuri. 2022. White-Box and Black-Box Fuzzing for GraphQL APIs., 22 pages. https://doi.org/10.48550/ARXIV.2209.05833Google ScholarCross Ref
- G. Brito, T. Mombach, and M. Valente. 2019. Migrating to GraphQL: A Practical Assessment. In 2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE Computer Society, Los Alamitos, CA, USA, 140–150. https://doi.org/10.1109/SANER.2019.8667986Google ScholarCross Ref
- Koen Claessen and John Hughes. 2000. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. SIGPLAN Not. 35, 9 (sep 2000), 268–279. https://doi.org/10.1145/357766.351266Google ScholarDigital Library
- Samuel da Silva Feitosa, Rodrigo Geraldo Ribeiro, and Andre Rauber Du Bois. 2019. Generating Random Well-Typed Featherweight Java Programs Using QuickCheck. Electronic Notes in Theoretical Computer Science 342 (2019), 3–20. https://doi.org/10.1016/j.entcs.2019.04.002 The proceedings of CLEI 2018, the XLIV Latin American Computing Conference.Google ScholarDigital Library
- Tomás Díaz, Federico Olmedo, and Éric Tanter. 2020. A Mechanized Formalization of GraphQL. In Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs (New Orleans, LA, USA) (CPP 2020). Association for Computing Machinery, New York, NY, USA, 201–214. https://doi.org/10.1145/3372885.3373822Google ScholarDigital Library
- European Commission. [n. d.]. GraphQL Validation Service. European Commission. https://joinup.ec.europa.eu/collection/interoperability-test-bed-repository/solution/graphql-validation-service/eif-perspectiveAcessado em 3 de junho de 2023.Google Scholar
- Guilherme Forte. 2022. REST APIs’ Exhaustion Signs. https://www.programmersinc.com/over-fetching-and-under-fetching-rest-apis-exhaustion-signs. Acesso em 2023/09/20 20:23:00.Google Scholar
- John Hughes. 2016. Experiences with QuickCheck: Testing the Hard Stuff and Staying Sane. Springer International Publishing, Cham, 169–186. https://doi.org/10.1007/978-3-319-30936-1_9Google ScholarCross Ref
- Stefan Karlsson, Adnan Causevic, and Daniel Sundmark. 2019. QuickREST: Property-based Test Generation of OpenAPI-Described RESTful APIs. 2020 IEEE 13th International Conference on Software Testing, Validation and Verification (ICST) (2019), 131–141.Google Scholar
- Stefan Karlsson, Adnan Čaušević, and Daniel Sundmark. 2021. Automatic Property-based Testing of GraphQL APIs. In 2021 IEEE/ACM International Conference on Automation of Software Test (AST). 1–10. https://doi.org/10.1109/AST52587.2021.00009Google ScholarCross Ref
- Agustín Mista, Alejandro Russo, and John Hughes. 2018. Branching Processes for QuickCheck Generators. SIGPLAN Not. 53, 7 (sep 2018), 1–13. https://doi.org/10.1145/3299711.3242747Google ScholarDigital Library
- Amit Pagrut, Ishant Pakmode, Shambhoo Kariya, Vibhavari Kamble, and Yashodhara Haribhakta. 2018. Automated SQL Query Generator by Understanding a Natural Language Statement. International Journal on Natural Language Computing 7 (06 2018), 01–11. https://doi.org/10.5121/ijnlc.2018.7301Google ScholarCross Ref
- Michał H. Pałka, Koen Claessen, Alejandro Russo, and John Hughes. 2011. Testing an Optimising Compiler by Generating Random Lambda Terms. In Proceedings of the 6th International Workshop on Automation of Software Test (Waikiki, Honolulu, HI, USA) (AST ’11). Association for Computing Machinery, New York, NY, USA, 91–97. https://doi.org/10.1145/1982595.1982615Google ScholarDigital Library
- Matheus Seabra, Marcos Felipe Nazário, and Gustavo Pinto. 2019. REST or GraphQL? A Performance Comparative Study. In Proceedings of the XIII Brazilian Symposium on Software Components, Architectures, and Reuse (Salvador, Brazil) (SBCARS ’19). Association for Computing Machinery, New York, NY, USA, 123–132. https://doi.org/10.1145/3357141.3357149Google ScholarDigital Library
- Daniela Meneses Vargas, Alison Fernandez Blanco, Andreina Cota Vidaurre, Juan Pablo Sandoval Alcocer, Milton Mamani Torres, Alexandre Bergel, and Stéphane Ducasse. 2018. Deviation testing: A test case generation technique for graphql apis. In 11th International Workshop on Smalltalk Technologies (IWST). 1–9.Google Scholar
- Louise Zetterlund. 2021. AutoGraphQL: An automated test generation tool for GraphQL.Google Scholar
Index Terms
- Usando Esquema GraphQL para Geração de Consultas de Forma Aleatória
Comments