首页 | 本学科首页   官方微博 | 高级检索  
     

与继承相关的C++程序错误模式
引用本文:廉婷丽 刘坚. 与继承相关的C++程序错误模式[J]. 微机发展, 2004, 14(7): 12-15
作者姓名:廉婷丽 刘坚
作者单位:西安电子科技大学软件工程研究所,西安电子科技大学软件工程研究所 陕西西安710071,陕西西安710071
基金项目:武器装备预研基金资助项目(51406070101DZ0151)
摘    要:分析了C 程序中与继承相关的错误模式,这些错误会引起程序的数据流异常和行为异常。给出了几种常见错误模式的表现形式,结合实例详细分析了这些错误模式的产生原因及特点,重点讨论了容易产生数据流异常的基类与派生类之间的状态一致性问题,得到错误模式的分类。最终达到使用错误模式指导程序分析,检测面向对象程序中的潜在异常,维护系统的安全的目的。

关 键 词:C++程序 继承 错误模式 数据流异常 行为异常 面向对象程序设计语言

Fault Patterns for Inheritance in C++ Programs
LIAN Ting-li,LIU Jian. Fault Patterns for Inheritance in C++ Programs[J]. Microcomputer Development, 2004, 14(7): 12-15
Authors:LIAN Ting-li  LIU Jian
Abstract:In this paper, fault patterns related to inheritance in C++ programs are analyzed, which may lead to data flow errors or program behavior errors. Representations of several familiar faults are listed, and the causes and characteristics of them are analyzed with examples in detail. Emphasis is put on the problem of state consistency between base class and its derived class, which can usually cause a data flow error.
Keywords:object-oriented program  inheritance  data flow error  
本文献已被 CNKI 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号