Current state-of-art CAM systems generate piecewise linear (G01-based) tool paths that lack G1 and G2 continuity. This paper presents a systematic solution of tool path B-spline fitting for improving the continuity and quality and a tool set to evaluate the quality of either G-Code commands or CNC-interpolated axis motion commands. The core of the solution involves a preprocessor and a cubic B-Spline fitting algorithm. The preprocessor identifies feature points (Hard Break Point Identification) and uses a point smoothing algorithm to improve the quality of the data points by minimizing the length sum subject to shape preserving and tolerance constraints. A B-Spline fitting algorithm based on least square approximation and energy minimization is used to ensure fair (shape-preserving) tool-paths with G2 continuity and stable curvature transition. The evaluation tool set computes quality criterions, such as G2 discontinuity locations, curvature, inflexion, jerks and torsion in the G-code or CNC-interpolated axis motion commands. All above algorithms are integrated into a software package. The validation of the effectiveness and efficiency of above solutions is performed by comparing tool-paths with and without the preprocessing and B-Spline fitting.