Skip to content

Commit ee8a4c8

Browse files
committed
mutation score
1 parent acfac7e commit ee8a4c8

66 files changed

Lines changed: 160 additions & 114 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lasso/src/components/SrmViewer/ClusteredSRMAccordionViewer.tsx

Lines changed: 96 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ export const ClusteredSRMAccordionViewer: React.FC<any> = ({
119119
const [error, setError] = useState<string | null>(null);
120120

121121
const [limitOracles, setLimitOracles] = useState(false);
122+
const [mutants, setMutants] = useState<CodeVersion[]>([]);
123+
const [mutantsKilled, setMutantsKilled] = useState<number>(0);
122124

123125
const [queryResponse, setQueryResponse] = useState<SearchSrmQueryResponse>()
124126

@@ -360,6 +362,22 @@ SELECT count(*) AS cluster_size, list(SYSTEMID) AS cluster_implementations, * EX
360362
const nonOriginalImpls = allImpls.filter(i => i.variantId !== 'original');
361363
const sortedImplsOriginal = [...originalImpls, ...nonOriginalImpls];
362364

365+
// identify if mutants are present
366+
const mutantImpls = allImpls.filter(i => i.variantId.startsWith('mutant'));
367+
if (mutantImpls && mutantImpls.length > 0) {
368+
setMutants(mutantImpls);
369+
370+
if (clusters.length > 0) {
371+
const clusterImpls = clusters.map((cluster) => parseDuckDBList(cluster.cluster_implementations)).find((impls) => {
372+
return impls.find((impl) => impl.variantId === 'original');
373+
});
374+
// FIXME identify cluster of original implementation
375+
console.log("Found cluster of original impl " + clusterImpls.length);
376+
377+
setMutantsKilled(mutantImpls.length - clusterImpls.length - 1);
378+
}
379+
}
380+
363381
const oracleImpls = sortedImplsOriginal.filter(i => i.id === 'oracle');
364382
const nonOracleImpls = sortedImplsOriginal.filter(i => i.id !== 'oracle');
365383
const sortedImpls = [...oracleImpls, ...nonOracleImpls];
@@ -657,57 +675,85 @@ SELECT count(*) AS cluster_size, list(SYSTEMID) AS cluster_implementations, * EX
657675

658676
{/* --- Cluster Statistics Panel --- */}
659677
{clusters.length > 0 && (
660-
<Box mb={2}>
661-
<Typography variant="h6" gutterBottom>Cluster Statistics</Typography>
662-
<Table size="small" sx={{ width: 'auto', mb: 1 }}>
663-
<TableHead>
664-
<TableRow>
665-
<TableCell>Color</TableCell>
666-
<TableCell>Cluster #</TableCell>
667-
<TableCell>Number of Implementations</TableCell>
668-
<TableCell>Implementations</TableCell>
669-
</TableRow>
670-
</TableHead>
671-
<TableBody>
672-
{clusters.map((cluster, idx) => {
673-
const clusterColor = getClusterColor(idx);
674-
const implementations = parseDuckDBList(cluster.cluster_implementations);
675-
return (
676-
<TableRow key={idx}>
677-
<TableCell>
678-
<Box sx={{
679-
background: clusterColor,
680-
width: 28, height: 18, borderRadius: '4px', border: '1px solid #bbb'
681-
}} />
682-
</TableCell>
683-
<TableCell>Cluster {idx + 1}</TableCell>
684-
<TableCell>{implementations.length}</TableCell>
685-
<TableCell>
686-
{implementations.map(i => `${i.id} (${i.variantId})`).join(", ")}
687-
</TableCell>
688-
</TableRow>
689-
);
690-
})}
691-
</TableBody>
692-
</Table>
693-
<Typography variant="body2">
694-
Total number of test cases: <b>{
695-
(() => {
696-
// All test invocation labels from all clusters
697-
const set = new Set();
698-
clusters.forEach(cluster => {
699-
Object.keys(cluster).forEach(key => {
700-
if (!['id', 'cluster_implementations', 'cluster_size', 'ABSTRACTIONID', 'unique_values'].includes(key)) {
701-
const testCase = key.split('@')[0];
702-
set.add(testCase);
703-
}
678+
<>
679+
{mutants.length > 0 && (
680+
<Box mb={2}>
681+
<Typography variant="h6" gutterBottom>Mutation Coverage</Typography>
682+
683+
<Typography variant="body2">
684+
Total number of mutants: <b>{mutants.length}</b>
685+
</Typography>
686+
<Typography variant="body2">
687+
Total number of killed mutants: <b>{mutantsKilled}</b>
688+
</Typography>
689+
<Typography variant="body2">
690+
Mutation Score: <b>{mutantsKilled / mutants.length}</b>
691+
</Typography>
692+
</Box>
693+
)}
694+
695+
<Box mb={2}>
696+
697+
<Typography variant="h6" gutterBottom>Cluster Statistics</Typography>
698+
<Typography variant="body2">
699+
Total number of test cases: <b>{
700+
(() => {
701+
// All test invocation labels from all clusters
702+
const set = new Set();
703+
clusters.forEach(cluster => {
704+
Object.keys(cluster).forEach(key => {
705+
if (!['id', 'cluster_implementations', 'cluster_size', 'ABSTRACTIONID', 'unique_values'].includes(key)) {
706+
const testCase = key.split('@')[0];
707+
set.add(testCase);
708+
}
709+
});
704710
});
705-
});
706-
return set.size;
707-
})()
708-
}</b>
709-
</Typography>
710-
</Box>
711+
return set.size;
712+
})()
713+
}</b>
714+
</Typography>
715+
<Typography variant="body2">
716+
Total number of code modules: <b>{
717+
(() => {
718+
return clusters.flatMap(cluster => {
719+
return parseDuckDBList(cluster.cluster_implementations);
720+
}).length;
721+
})()
722+
}</b>
723+
</Typography>
724+
<br />
725+
<Table size="small" sx={{ width: 'auto', mb: 1 }}>
726+
<TableHead>
727+
<TableRow>
728+
<TableCell>Color</TableCell>
729+
<TableCell>Cluster #</TableCell>
730+
<TableCell>Number of Implementations</TableCell>
731+
<TableCell>Implementations</TableCell>
732+
</TableRow>
733+
</TableHead>
734+
<TableBody>
735+
{clusters.map((cluster, idx) => {
736+
const clusterColor = getClusterColor(idx);
737+
const implementations = parseDuckDBList(cluster.cluster_implementations);
738+
return (
739+
<TableRow key={idx}>
740+
<TableCell>
741+
<Box sx={{
742+
background: clusterColor,
743+
width: 28, height: 18, borderRadius: '4px', border: '1px solid #bbb'
744+
}} />
745+
</TableCell>
746+
<TableCell>Cluster {idx + 1}</TableCell>
747+
<TableCell>{implementations.length}</TableCell>
748+
<TableCell>
749+
{implementations.map(i => `${i.id} (${i.variantId})`).join(", ")}
750+
</TableCell>
751+
</TableRow>
752+
);
753+
})}
754+
</TableBody>
755+
</Table>
756+
</Box></>
711757
)}
712758

713759
<Dialog open={!!openTestCase} onClose={() => setOpenTestCase(null)} maxWidth="md" fullWidth>

web/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="generator" content="Docusaurus v3.7.0">
66
<title data-rh="true">Page Not Found | LASSO</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://softwareobservatorium.github.io/web/img/docusaurus-social-card.jpg"><meta data-rh="true" name="twitter:image" content="https://softwareobservatorium.github.io/web/img/docusaurus-social-card.jpg"><meta data-rh="true" property="og:url" content="https://softwareobservatorium.github.io/web/404.html"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="Page Not Found | LASSO"><link data-rh="true" rel="icon" href="/web/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://softwareobservatorium.github.io/web/404.html"><link data-rh="true" rel="alternate" href="https://softwareobservatorium.github.io/web/404.html" hreflang="en"><link data-rh="true" rel="alternate" href="https://softwareobservatorium.github.io/web/404.html" hreflang="x-default"><link rel="alternate" type="application/rss+xml" href="/web/blog/rss.xml" title="LASSO RSS Feed">
77
<link rel="alternate" type="application/atom+xml" href="/web/blog/atom.xml" title="LASSO Atom Feed"><link rel="stylesheet" href="/web/assets/css/styles.a32aa24b.css">
8-
<script src="/web/assets/js/runtime~main.e2cacb1b.js" defer="defer"></script>
8+
<script src="/web/assets/js/runtime~main.dc731433.js" defer="defer"></script>
99
<script src="/web/assets/js/main.972608fb.js" defer="defer"></script>
1010
</head>
1111
<body class="navigation-with-keyboard">

web/about/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="generator" content="Docusaurus v3.7.0">
66
<title data-rh="true">About LASSO | LASSO</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://softwareobservatorium.github.io/web/img/docusaurus-social-card.jpg"><meta data-rh="true" name="twitter:image" content="https://softwareobservatorium.github.io/web/img/docusaurus-social-card.jpg"><meta data-rh="true" property="og:url" content="https://softwareobservatorium.github.io/web/about"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="About LASSO | LASSO"><meta data-rh="true" name="description" content="Team / Authors"><meta data-rh="true" property="og:description" content="Team / Authors"><link data-rh="true" rel="icon" href="/web/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://softwareobservatorium.github.io/web/about"><link data-rh="true" rel="alternate" href="https://softwareobservatorium.github.io/web/about" hreflang="en"><link data-rh="true" rel="alternate" href="https://softwareobservatorium.github.io/web/about" hreflang="x-default"><link rel="alternate" type="application/rss+xml" href="/web/blog/rss.xml" title="LASSO RSS Feed">
77
<link rel="alternate" type="application/atom+xml" href="/web/blog/atom.xml" title="LASSO Atom Feed"><link rel="stylesheet" href="/web/assets/css/styles.a32aa24b.css">
8-
<script src="/web/assets/js/runtime~main.e2cacb1b.js" defer="defer"></script>
8+
<script src="/web/assets/js/runtime~main.dc731433.js" defer="defer"></script>
99
<script src="/web/assets/js/main.972608fb.js" defer="defer"></script>
1010
</head>
1111
<body class="navigation-with-keyboard">

web/assets/js/3ad343e8.b8ad5de8.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/assets/js/3ad343e8.ce9601de.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)