# Bug count

Bug count is a very traditional quality metric, and while it provides the least information about your quality level the trend can sometimes tell you important information.

A bug is a failure to meet customer's level of expectation, and so naturally you can either fix a bug by changing your code or by changing what the customer expects. Be careful with high bug counts, as customers tend to grow reliant on the 'wrong' behaviors.

Given an id for an integration (with type Jira), you can query bug count like so:

curl -H "X-API-Key: <your token goes here>" \
https://api.accidentalquality.com/api/bug_counts/<integration_id>
fetch('https://api.accidentalquality.com/api/bug_counts/<integration_id>', {
  method: "GET",
  headers: {"Content-type": "application/json;charset=UTF-8", "X-API-Key": "<your-token-goes-here>"}
})
.then(response => response.json()) 
.then(json => console.log(json)) 
.catch(err => console.log(err));

The data returned is in json format and structured as follows:

  • unit (string) - Unit of the data displayed in the data array
  • data (array)
    • x string - Date for the datapoint in format yyyy-mm-dd
    • y integer - Open bugs on that day. Changes over time as bugs are reopened or closed.

Example:

    {
        "unit":"Date/Bug count",
        "data": [
            {
                "x": "1990-01-01",
                "y": 123
            },
            {
                "x": "1990-01-02",
                "y": 321
            },
            ...
        ]
    }