LadyBugML / ladybug

Bug Localization
3 stars 1 forks source link

Investigative Task: Python Backend #2

Closed StudentJamesChen closed 5 days ago

StudentJamesChen commented 1 month ago

Estimated Effort:

Dependencies:

Initial Assignments:

Milestone:

Acceptance Criteria:

StudentJamesChen commented 1 month ago

@Noway-code @SamarKaranch Please look into these:

https://probot.github.io/docs/

https://developer.android.com/studio/test/other-testing-tools/monkey

and Python backends such as Flask, FastAPI, and Django.

StudentJamesChen commented 1 month ago

Short quick notes, but please delve deeper into these:

Flask - A lightweight web framework that is easy to set up for handling GitHub webhooks and small to medium-sized bot functionalities.

FastAPI - A modern, fast web framework that supports asynchronous programming, ideal for high-performance bots needing concurrency and automatic API documentation.

Django - A full-featured web framework suitable for bots requiring a more extensive backend, including database support, user management, and complex data handling.

Noway-code commented 1 month ago

Research


Probot

Probot is a lightweight framework built on Node.js with TypeScript, making it a good fit for our project. It offers the right level of abstraction and should be relatively easy to set up. However, it will require hosting, which could be done on Patrick's server, Docker, Heroku, or another platform.

A basic setup might look like this:

module.exports = (app) => {
  app.on('issues.opened', async (context) => {
    // Extract the GitHub issue's content
    const issue = context.payload.issue;
    const issueTitle = issue.title;
    const issueBody = issue.body;

    // Log the raw content
    console.log('Issue title:', issueTitle);
    console.log('Issue body:', issueBody);

    // Regular expression to find image URLs
    const imageUrls = issueBody.match(/!\[.*\]\((.*)\)/);
    if (imageUrls) {
      imageUrls.forEach(imageUrl => {
        console.log('Image URL:', imageUrl);
      });
    }

    // Pass to bug localization or further processing
  });
};

Monkey

Monkey is a tool that runs on your emulator or device, generating pseudo-random streams of user events like clicks, touches, gestures, and some system events. However, due to its random nature, it can't reproduce specific steps, making it more suitable for stress-testing applications. While useful for QA, its value in this project is limited as it doesn't follow precise bug reproduction steps or provide detailed GUI information. We would need additional tools to capture and analyze screen states effectively.


"Crawling"

The distinction between manual and automatic extraction of GUI information is imporatant in understanding the confusion around app crawling. The main difference is that manual crawling involves a person reproducing the bug while capturing the relevant GUI information, whereas automatic crawling involves scripting the process to pull that information.

Flask

Flask is well-suited for our needs. It’s great for projects that mostly interact with APIs and run external programs. It’s simple, flexible, and has a large ecosystem. Since our project doesn’t involve complex communication—acting more as a middleman between GitHub and the bug localization system—Flask is a solid choice.

FastAPI

FastAPI is a modern, high-performance framework designed for asynchronous operations. It excels at handling multiple concurrent requests, which is useful for I/O-bound tasks like interacting with external APIs. However, since our project involves low communication overhead, with requests occurring infrequently, FastAPI may be overkill. It's also newer with a smaller ecosystem.

Django

Django likely isn’t the right fit here. It's a heavier framework typically used for larger, scalable applications that require features like user authentication, dashboards, and ORMs. While Django is powerful, its complexity and steep learning curve make it excessive for our project's backend needs.

Noway-code commented 1 month ago

Estimated Effort:

Dependencies:

Initial Assignments:

Milestone:

Acceptance Criteria: