To describe the modular structure of numerical control (NC) system and deal with the problem of interference between modules in software reliability analysis, a module dependency graph (MDG) was presented and a scenario-based scheme was proposed. MDG describes reliability of module in different application environment, module dependency and structure of software with establishing maps among modules, execution scenarios and reliability. According to the information shown in MDG, an algorithm based on the idea of traversing directed graph in graph theory was proposed. The algorithm calculates the reliability of scenario with breadth-first principle. The reliability of system could be obtained from reliability and running frequency of scenario. The scheme eliminates the defects of the conventional methods which ignore module correlation. Case study proves the scheme could evaluate the reliability of NC software effectively.