skip to main content
10.1145/3624309.3624321acmotherconferencesArticle/Chapter ViewAbstractPublication PagessblpConference Proceedingsconference-collections
research-article

Usando Esquema GraphQL para Geração de Consultas de Forma Aleatória

Published:02 November 2023Publication History

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.

References

  1. GraphQL 2023. GraphQL. GraphQL. https://graphql.orgGoogle ScholarGoogle Scholar
  2. GraphQL 2023. GraphQL Foundation. GraphQL. https://graphql.org/foundation/Google ScholarGoogle Scholar
  3. GraphQL 2023. GraphQL Spec. GraphQL. https://spec.graphql.org/draftGoogle ScholarGoogle Scholar
  4. GraphQL 2023. Schemas and Types. GraphQL. https://graphql.org/learn/schema/#type-systemGoogle ScholarGoogle Scholar
  5. 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 ScholarGoogle ScholarCross RefCross Ref
  6. 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 ScholarGoogle ScholarCross RefCross Ref
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle Scholar
  11. 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 ScholarGoogle Scholar
  12. 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 ScholarGoogle ScholarCross RefCross Ref
  13. 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 ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarCross RefCross Ref
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarCross RefCross Ref
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle Scholar
  20. Louise Zetterlund. 2021. AutoGraphQL: An automated test generation tool for GraphQL.Google ScholarGoogle Scholar

Index Terms

  1. Usando Esquema GraphQL para Geração de Consultas de Forma Aleatória

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Other conferences
          SBLP '23: Proceedings of the XXVII Brazilian Symposium on Programming Languages
          September 2023
          110 pages
          ISBN:9798400716287
          DOI:10.1145/3624309

          Copyright © 2023 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 2 November 2023

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article
          • Research
          • Refereed limited

          Acceptance Rates

          Overall Acceptance Rate22of50submissions,44%
        • Article Metrics

          • Downloads (Last 12 months)6
          • Downloads (Last 6 weeks)1

          Other Metrics

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        HTML Format

        View this article in HTML Format .

        View HTML Format