![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
mutation-server-protocol
Advanced tools
Schema validation for the mutation server protocol (MSP).
The Mutation Server Protocol (MSP) provides endpoints for IDEs to run mutation testing and report the progress.
[!NOTE]
Inspired by the Language Server Protocol
This document describes the 0.1 version of the mutation server protocol.
The base protocol exchanges JSON-RPC 2.0 messages between the client and the server via a socket connection. The server must answer each request from the client with a response. The server may also send notifications to the client. The protocol is designed to be language agnostic and can be used with any programming language.
The mutation server must:
{"port": 1234 }
.The client parses this message and connects to the server.
The protocol may support additional inter-process communication (IPC) methods, such as standard input/output (stdio), pipes, and sockets.
[!TIP] Locations are reported as part of the messages are always 1-based. The first line in a file is 1, and the first column in a line is 1.
Content-Length: ...\r\n
\r\n
{
"jsonrpc": "2.0",
"id": 1,
"method": "discover",
"params": {
...
}
}
The message above is a request to the server or from the server to the client. Each message contains a Content-Length
header that specifies the length of the content part. The message is encoded as UTF-8.
The discover
and mutationTest
methods accept file paths as an array of strings. A path that ends with /
indicates a directory.
Each path can specify exactly which code blocks to mutate/discover using a mutation range. This can be done by postfixing your file with :startLine[:startColumn]-endLine[:endColumn]
. Some examples:
"src/app.js:1-11"
"src/app.js:5:4-6:4"
"src/util/"
The MSP defines the following methods:
discover
: Discovers mutants in the given file paths.mutationTest
: The method to start a mutation test run.The configure
method is used to configure the server. The server must respond with a ConfigureResult
message.
export interface ConfigureParams {
/**
* The (relative or absolute) path to mutation testing framework's config file to load.
*/
configFilePath?: string;
}
export interface ConfigureResult {
/**
* The mutation testing server protocol major version that the client supports (major)
* For example, "1"
*/
version: string;
}
The discover
method is used to discover mutants in the given file paths. The server must respond with a DiscoverResult
message.
The DiscoveredMutant
type is a subset of the MutantResult
type. The MutantResult
is the type that can be found in the mutation testing report schema.
type DiscoverParams = {
/**
* The files to run discovery on, or undefined to discover all files in the current project.
* A file ending with a `/` indicates a directory. Each path can specify exactly which code blocks to mutate/discover using a mutation range.
* This can be done by postfixing your file with `:startLine[:startColumn]-endLine[:endColumn]`.
*/
files?: string[];
};
type DiscoverResult = {
files: DiscoveredFiles;
};
type DiscoveredFiles = Record<string, DiscoveredFile>;
type DiscoveredFile = {
mutants: DiscoveredMutant[];
};
type DiscoveredMutant = {
id: string;
location: Location;
description?: string;
mutatorName: string;
replacement?: string;
};
type Location = {
start: Position;
end: Position;
};
type Position = {
line: number;
column: number;
};
The mutationTest
method starts a mutation test run. The server must respond with a MutationTestResult
message.
Whenever a partial result is in, the server is expected to send a reportMutationTestProgress
notification with the partial result as MutationTestResult
.
[!NOTE] The MutantResult should adhere to the mutation testing report schema
type MutationTestParams = {
/**
* The files to run mutation testing on, or undefined to run mutation testing on all files in the current project.
* A file ending with a `/` indicates a directory. Each path can specify exactly which code blocks to mutate/discover using a mutation range.
* This can be done by postfixing your file with `:startLine[:startColumn]-endLine[:endColumn]`.
*/
files?: string[];
};
type MutationTestResult = {
files: MutantResultFiles;
};
type MutantResultFiles = Record<string, MutantResultFile>;
type MutantResultFile = {
mutants: MutantResult[];
};
type MutantResult = DiscoveredMutant & {
coveredBy?: string[];
duration?: number;
killedBy?: string[];
static?: boolean;
status: MutantStatus;
statusReason?: string;
testsCompleted?: number;
};
type MutantStatus =
| 'Killed'
| 'Survived'
| 'NoCoverage'
| 'Timeout'
| 'CompileError'
| 'RuntimeError';
TODO
FAQs
Schema validation for the mutation server protocol (MSP).
The npm package mutation-server-protocol receives a total of 2 weekly downloads. As such, mutation-server-protocol popularity was classified as not popular.
We found that mutation-server-protocol demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.