Frontend Development 11 min read

Test Report and Probability Analysis of the 2022 Annual Meeting Lottery Tool

This report details the development, requirements, core JavaScript implementation, probability testing, and functional verification of the 2022 annual meeting lottery tool, demonstrating that the random selection algorithm yields fair and statistically expected results for all prize tiers.

NetEase LeiHuo Testing Center
NetEase LeiHuo Testing Center
NetEase LeiHuo Testing Center
Test Report and Probability Analysis of the 2022 Annual Meeting Lottery Tool

When delivering a finished software product, a test report is an essential document. This article uses the 2022 annual meeting lottery tool as an example to illustrate how to write a comprehensive test report.

Overview

The tool reuses the 2020 lottery application with modifications to the prize configuration, front‑end display (logo, fonts, prize images), and a confirmation dialog when clearing results. No other parts were changed.

Requirements

Prize settings for six rounds (five‑level prizes and a surprise prize) with specific numbers of winners per round.

Only formal employees are eligible.

Random selection is independent across rounds; the first five rounds exclude already‑won participants, while the surprise prize does not exclude them.

A re‑draw mechanism exists for single‑slot prizes, but for this event only a double‑confirmation dialog is needed.

Winning records are stored locally to survive crashes, refreshes, or restarts.

Core Code Review

The core random function relies on JavaScript's Math.random() to generate a floating‑point number in [0,1). The algorithm scales and floors the value to select a candidate, pushes the winner to a temporary array, and removes the selected candidate from the pool using splice . All data are persisted in localStorage so that the state survives page reloads.

For the surprise prize, the candidate list is reconstructed by concatenating previously won participants before selection.

The scrolling animation calls a scroll() function every 100 ms, but the actual random selection occurs only when the user clicks the start button, ensuring that the animation duration does not affect the probability.

Probability Testing

Ten thousand simulated draws were performed, storing results locally. The test used 182 formal employees and varied prize counts (e.g., 96 fifth‑prize slots, 56 fourth‑prize slots, etc.). The observed winning frequencies for each prize tier closely matched the theoretical probabilities derived from combinatorial calculations, with low variance and standard deviation, confirming fairness.

Statistical results for each tier (e.g., fifth‑prize probability ≈ 52.75%, fourth‑prize ≈ 30.77%, third‑prize ≈ 8.24%, second‑prize ≈ 3.30%, first‑prize ≈ 0.55%, surprise prize ≈ 2.20%) were visualized in charts and matched expected values.

Test Description

Functional tests covered UI navigation, prize display, scrolling, stopping, double‑confirmation, record keeping, and page refresh handling. Exception tests simulated browser closure and refresh during draws, confirming that partial results are correctly saved and can be resumed.

Boundary tests examined the first and last entries in the employee list, showing no abnormal winning probabilities.

Conclusion

The lottery tool’s random algorithm provides equal winning chances for all participants across all prize levels, and the implementation reliably preserves state across interruptions.

frontendJavaScripttestingprobabilitylotteryreport
NetEase LeiHuo Testing Center
Written by

NetEase LeiHuo Testing Center

LeiHuo Testing Center provides high-quality, efficient QA services, striving to become a leading testing team in China.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.