@testsudo/testsudo
v1.0.12
Published
Comprehensive development optimization tool for front-end, back-end and security
Downloads
10
Readme
Testsudo v1.0
Product Description
Welcome to Testsudo, a one-stop testing suite enabling you to test your project's frontend, backend, and security performance!
With a simple CLI command, Testsudo will perform some testing magic and give you a range of metrics for your project on a compatible web application. Rather than searching for 3 separate performance optimization tools, Testsudo abstracts that away into a single command.
Testsudo allows you to:
- Track multiple projects on the web application, each with its own unique Dashboard
- Test each page of your project and drills down into the metrics by path
Instructions on using the Testsudo Module
Sign up and login to Testsudo http://testsudo.com.
Create a new project and copy the Project ID.
On your terminal, run
npm i @testsudo/testsudo
.Create a
testsudoConfig.js
in the root directory of your consuming app.
module.exports = {
frontEndUrl: 'http://localhost:3000', // insert url of what project you want to test
projectID: '123456', // insert project id from the web app in quotes
enableSecurityScan: true, // set to false to turn security tests off
enableFrontEndScan: true, // set to false to turn front end tests off
enableBackEndScan: true // set to false to turn back end tests off
};
- In the consuming app’s server.js file, add the following code immediately after app is initialized (
const app = express()
):
If using CommonJS:
const testsudo = require(‘@testsudo/testsudo’);
const testsudoConfig = require(‘../testsudoConfig.js’); // make sure this is the actual location of testsudoConfig.js
testsudo.initializeTestsudo(app, testsudoConfig);
If using ES6+:
import testsudo from 'testsudo';
import testsudoConfig from '../testsudoConfig.js'; // make sure this is the actual location of testsudoConfig.js
testsudo.initializeTestsudo(app, testsudoConfig);
Run your development environment as you would normally would (e.g., npm run dev).
Review your project dashboard on Testsudo http://testsudo.com
Frontend Testing
Lighthouse metrics
Of 05/13/2024 the latest version of Lighthouse is 12.
Core Web Vitals:
Performance
Lighthouse 10 Audit Scoring System
Understanding LHR (Lighthouse Result Object)
| acronym | audit categories | Weight | Brief Description | | ------- | ----------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ | | FCP | First Contenful Paint | 10% | Marks the time at which the first text or image is painted | | SI | Speed Index | 10% | Shows how quickly the contents of a page are visibly populated | | TBT | Total Blocking Time | 25% | Sum of all time periods between FCP and Time to Interactive (i.e., the amount of time it takes for the page to be fully interactive) | | LCP | Largest Contenful Paint | 30% | Marks the time at which the largest text or image is painted | | CLS | Cumulative Layout Shift | 25% | Measures the movement of visible elements within the viewport |
|
[Accessibility] (https://developer.chrome.com/docs/lighthouse/accessibility/scoring)
Each metrics are pass/fail, weighted score of importance from 1-10.
Some examples of Accessiblity Metrics:
| description | weight | | ------------------------------------------------------------------------------------------------------ | ------ | | Button has accessible names | (10) | | No Forms have multiple lablels | (3) | | Links must have descernible text | (7) | | Image buttons must have alternate text | (10) |
Best Practices
Backend Testing
Backend testing is an essential practice in software development that tests the server-side components of applications. This process ensures that the backend functions effectively under various conditions, supporting stability, performance, and security. It verifies server-side logic, database operations, API interactions, and other backend services. Implementing comprehensive backend testing with Testsudo, which utilizes the Measured module, allows developers to detect and address potential issues related to performance bottlenecks, errors, and inefficiencies.
Testsudo leverages the Measured module to provide detailed insights into backend operations through real-time metrics collection. Here are the key metrics tracked by the module:
Security Testing
Security Metrics Warning Categories:
- Warning
- Low
- Medium
- High
- Critical
You can click a warning category of the pie chart to isolate only warnings of that kind in the other sections.
The Security Vulnerabilities section will display a breakdown of the quantity of each vulnerability your project has by title.
The Location of Vulnerabilities section will show the type of vulnerability along with the file location of the vulnerability inside of your project.
Contributors
- 🐙 = Github