Software reliability is critical for many applications. The pervasiveness of multi-core hardware and parallel programming makes parallel bugs become an increasingly important and urgent issue. Concurrency bugs together with the other types of bugs have significantly impacted software reliability. Although much effort has been put on detecting software bugs, existing work is still far from ideal, and many bugs, especially those in parallel or distributed programs, are still difficult to catch by existing tools. This proposal makes a major step toward improving the correctness of software, especially parallel and distribute software, by proposing a novel and widely applicable invariance, called data-flow invariance, that can be used to detect various types of software bugs, including parallel bugs and other types of bugs, and make software more reliable and secure. We strongly believe that our proposed research can effectively improve our understanding of this challenge, provide substantial tool support to software development, and greatly improve the quality of parallel and distributed software. We have also planned various educational and outreach activities for students, especially women students in computer science.