@@ -238,13 +238,13 @@ describe("T-Test Integration with analyze", () => {
238238 assert . strictEqual ( testResult . significanceTest , undefined ) ;
239239 } ) ;
240240
241- it ( "should include significanceTest when ttest is true and opsSecPerRun >= 30" , ( ) => {
242- // Generate 30+ opsSecPerRun samples (from repeatSuite)
243- const baselineOpsSecPerRun = Array . from (
241+ it ( "should include significanceTest when ttest is true and samples >= 30" , ( ) => {
242+ // Generate 30+ samples
243+ const baselineSampleData = Array . from (
244244 { length : 30 } ,
245245 ( _ , i ) => 100 + ( i % 3 ) - 1 ,
246246 ) ;
247- const testOpsSecPerRun = Array . from (
247+ const testSampleData = Array . from (
248248 { length : 30 } ,
249249 ( _ , i ) => 200 + ( i % 3 ) - 1 ,
250250 ) ;
@@ -254,12 +254,12 @@ describe("T-Test Integration with analyze", () => {
254254 name : "baseline" ,
255255 opsSec : 100 ,
256256 baseline : true ,
257- opsSecPerRun : baselineOpsSecPerRun ,
257+ histogram : { sampleData : baselineSampleData } ,
258258 } ,
259259 {
260260 name : "test" ,
261261 opsSec : 200 ,
262- opsSecPerRun : testOpsSecPerRun ,
262+ histogram : { sampleData : testSampleData } ,
263263 } ,
264264 ] ;
265265
@@ -272,7 +272,7 @@ describe("T-Test Integration with analyze", () => {
272272 assert . ok ( typeof testResult . significanceTest . confidence === "string" ) ;
273273 } ) ;
274274
275- it ( "should not include significanceTest without opsSecPerRun " , ( ) => {
275+ it ( "should not include significanceTest without sufficient samples " , ( ) => {
276276 const results = [
277277 {
278278 name : "baseline" ,
@@ -288,22 +288,22 @@ describe("T-Test Integration with analyze", () => {
288288 const analyzed = analyze ( results , true , { ttest : true } ) ;
289289 const testResult = analyzed . find ( ( r ) => r . name === "test" ) ;
290290
291- // Should not throw, and significanceTest should not be set (no opsSecPerRun )
291+ // Should not throw, and significanceTest should not be set (no samples )
292292 assert . strictEqual ( testResult . significanceTest , undefined ) ;
293293 } ) ;
294294
295- it ( "should not include significanceTest when opsSecPerRun < 30" , ( ) => {
295+ it ( "should not include significanceTest when samples < 30" , ( ) => {
296296 const results = [
297297 {
298298 name : "baseline" ,
299299 opsSec : 100 ,
300300 baseline : true ,
301- opsSecPerRun : Array . from ( { length : 10 } , ( ) => 100 ) ,
301+ histogram : { samples : Array . from ( { length : 10 } , ( ) => 100 ) } ,
302302 } ,
303303 {
304304 name : "test" ,
305305 opsSec : 200 ,
306- opsSecPerRun : Array . from ( { length : 10 } , ( ) => 200 ) ,
306+ histogram : { samples : Array . from ( { length : 10 } , ( ) => 200 ) } ,
307307 } ,
308308 ] ;
309309
@@ -315,12 +315,12 @@ describe("T-Test Integration with analyze", () => {
315315 } ) ;
316316
317317 it ( "should detect significant difference between clearly different benchmarks" , ( ) => {
318- // Generate 30+ opsSecPerRun with clearly different means
319- const baselineOpsSecPerRun = Array . from (
318+ // Generate 30+ samples with clearly different means
319+ const baselineSampleData = Array . from (
320320 { length : 30 } ,
321321 ( _ , i ) => 100 + ( i % 5 ) - 2 ,
322322 ) ;
323- const fastOpsSecPerRun = Array . from (
323+ const fastSampleData = Array . from (
324324 { length : 30 } ,
325325 ( _ , i ) => 200 + ( i % 5 ) - 2 ,
326326 ) ;
@@ -330,12 +330,12 @@ describe("T-Test Integration with analyze", () => {
330330 name : "baseline" ,
331331 opsSec : 100 ,
332332 baseline : true ,
333- opsSecPerRun : baselineOpsSecPerRun ,
333+ histogram : { sampleData : baselineSampleData } ,
334334 } ,
335335 {
336336 name : "fast" ,
337337 opsSec : 200 ,
338- opsSecPerRun : fastOpsSecPerRun ,
338+ histogram : { sampleData : fastSampleData } ,
339339 } ,
340340 ] ;
341341
@@ -348,12 +348,12 @@ describe("T-Test Integration with analyze", () => {
348348
349349 it ( "should not mark as significant when differences are within noise" , ( ) => {
350350 // Same benchmark run twice - should have similar results with high variance overlap
351- // Generate 30+ opsSecPerRun with overlapping distributions
352- const baselineOpsSecPerRun = Array . from (
351+ // Generate 30+ samples with overlapping distributions
352+ const baselineSampleData = Array . from (
353353 { length : 30 } ,
354354 ( _ , i ) => 100 + ( ( i % 5 ) - 2 ) * 2 ,
355355 ) ;
356- const similarOpsSecPerRun = Array . from (
356+ const similarSampleData = Array . from (
357357 { length : 30 } ,
358358 ( _ , i ) => 101 + ( ( i % 5 ) - 2 ) * 2 ,
359359 ) ;
@@ -363,12 +363,12 @@ describe("T-Test Integration with analyze", () => {
363363 name : "baseline" ,
364364 opsSec : 100 ,
365365 baseline : true ,
366- opsSecPerRun : baselineOpsSecPerRun ,
366+ histogram : { sampleData : baselineSampleData } ,
367367 } ,
368368 {
369369 name : "similar" ,
370370 opsSec : 101 , // Very close to baseline
371- opsSecPerRun : similarOpsSecPerRun ,
371+ histogram : { sampleData : similarSampleData } ,
372372 } ,
373373 ] ;
374374
@@ -384,18 +384,18 @@ describe("Statistical significance requires repeatSuite >= 30", () => {
384384 const { analyze } = require ( "../lib/utils/analyze" ) ;
385385
386386 it ( "should only compute significance when repeatSuite provides 30+ samples" , ( ) => {
387- // With 30+ opsSecPerRun , significance should be computed
387+ // With 30+ samples , significance should be computed
388388 const results = [
389389 {
390390 name : "baseline" ,
391391 opsSec : 100 ,
392392 baseline : true ,
393- opsSecPerRun : Array . from ( { length : 30 } , ( ) => 100 ) ,
393+ histogram : { sampleData : Array . from ( { length : 30 } , ( ) => 100 ) } ,
394394 } ,
395395 {
396396 name : "test" ,
397397 opsSec : 200 ,
398- opsSecPerRun : Array . from ( { length : 30 } , ( ) => 200 ) ,
398+ histogram : { sampleData : Array . from ( { length : 30 } , ( ) => 200 ) } ,
399399 } ,
400400 ] ;
401401
@@ -406,18 +406,18 @@ describe("Statistical significance requires repeatSuite >= 30", () => {
406406 } ) ;
407407
408408 it ( "should not compute significance when repeatSuite < 30" , ( ) => {
409- // With fewer than 30 opsSecPerRun , significance should not be computed
409+ // With fewer than 30 samples , significance should not be computed
410410 const results = [
411411 {
412412 name : "baseline" ,
413413 opsSec : 100 ,
414414 baseline : true ,
415- opsSecPerRun : Array . from ( { length : 10 } , ( ) => 100 ) ,
415+ histogram : { sampleData : Array . from ( { length : 10 } , ( ) => 100 ) } ,
416416 } ,
417417 {
418418 name : "test" ,
419419 opsSec : 200 ,
420- opsSecPerRun : Array . from ( { length : 10 } , ( ) => 200 ) ,
420+ histogram : { sampleData : Array . from ( { length : 10 } , ( ) => 200 ) } ,
421421 } ,
422422 ] ;
423423
0 commit comments