SoftwareEngineering-Theory and Practice
SE-121《软件工程专业导论》课程教学大纲

Laboratory Sessions
学时合计
34
Total Hours
Prof. Hui-you CHANG Email : isschy@ Homepage : /informationsystem/Article.aspx?id=3659
常会友教授、李文军教授、周晓聪副教授、余阳副教授、衣杨副教授、刘宁副教授
Prof. Hui-you CHANG, Prof. Wen-jun LI, A/Prof. Yang YU, A/Prof. Xiao-cong ZHOU, A/Prof.
Yang YI, A/Prof. Ning LIU 每班配置 1 名 TA,负责批改作业、实验报告并指导实验过程。
-1-
先修课程 Prerequisites
后续课程 Successive
Courses
教材 Textbook
教学参考书 References
教学方法 Approach 理论教学内容 Lectures
Introduction to Software Engineering is a fundamental course for those students who major in software engineering. This course focuses on the topics of the knowledge body, discipline foundations, and professional requirements for software engineers. Basic concepts and principles in computer science are covered in this course, including: computation models, digital systems, digital logic and integrated circuits, computer hardware and software, computer languages and programs, data management, and information processing. The students are also equipped with the fundamentals, methodologies, histories and disciplines of computing science. Furthermore, basic concepts and principles of software engineering and project management are also introduced.
清华大学计算机系本科生全部课程详细介绍

Introduct theme, equal emphasis on theory and practice. It also introduces the basic methods an
ion learning, simulated annealing, genetic algorithm and artificial neural network.
讲
姓名
职称
课
教
主要教学和科研领域
师
白晓颖
讲师 软件工程,软件测试
课号:00240042 学分: 2 课程名称 中文
课程属性: 全校任选 开课学期: 人工智能导论
书名
春季
作者
英文
Artificial Intelligence:
Stuart Russell and
A Modern Approach
Peter Norvig
程 法,主要的知识表示和推理方法,以及几个应用领域中所涉及的人工智能问题和求解方法。课程以智能体
简 设计为主线,将人工智能中相互分离的领域与内容统一起来,注重理论与实际应用相结合。同时还简单介
介 、人工神经网络等算法思想及相关成果与进展。
This course is an introduction course to offer the basic principles and methods of art
evolution. The purpose is to improve the students’ engineering capabilities and development Based on the major activities in software lifecycle, the course introduces the basic theory
816-实用软件工程

Software Crisis !
问题出在哪里?
⑴ 项目没有被很好地理解;计划不周,最终导致进度拖 延。
例1. In the late 1960s, a bright-eyed young engineer* was
chosen to “write” a computer program for an automated manufacturing application. The reason for his selection was simple. He was the only person in his technical group who had attended a computer programming seminar. He knew the in’s and out’s of assembler language and Fortran, but nothing about software engineering and even less about project scheduling and tracking.
A week later the boss called the engineer into his office and asked, “Where are we?” “Everything’s going well,” said the youngster, “but I’ve run into a few small snags. I’ll get them ironed out and be back on track soon.” “How does the deadline look?” the boss asked. “No problem,” said the engineer. “I’m close to 90 percent complete.” If you’ve been working in the software world for more than a few years, you can finish the story. It’ll come as no surprise that the young engineer stayed 90 percent complete for the entire project duration and only finished (with the help of others) one month late.
软工学习资料推荐

软工学习资料推荐软件工程(Software Engineering)是一门研究和应用如何以系统化和规范化的方法去构建、运行、维护和管理软件的学科。
对于软件工程学习者来说,掌握优质的学习资料是非常重要的,它们可以帮助我们深入了解软件工程的理论和实践,提升我们的编程能力和项目管理技巧。
本文将向广大软工学习者推荐一些值得阅读的软工学习资料。
一、软件工程导论1. 《软件工程导论》(Introduction to Software Engineering)- Ian Sommerville这本书是软件工程学习的经典教材,已经成为了许多大学软工专业的教材之一。
作者通过清晰简洁的语言,详细介绍了软件工程的各个方面,包括软件开发过程、需求分析、软件设计、软件测试等。
它不仅适合软件工程专业的学生,也适合其他对软工感兴趣的读者。
2. 《软件工程:实践者的研究方法》(Software Engineering: A Practitioner's Approach)- Roger S. PressmanPressman的这本书是软件工程领域的经典著作之一,对软件开发的整个过程进行了深入的介绍和剖析。
书中包含丰富的案例和实践经验,让读者能够更好地理解软件工程中的实际问题和解决方法。
二、软件需求工程1. 《软件需求工程》(Software Requirements Engineering)- Karl Wiegers、Joy Beatty这本书主要介绍了软件需求工程的理论和实践。
作者通过大量的示例和案例,详细讲解了如何正确地进行需求分析和需求管理,以及如何定义和验证软件需求。
对于从事软件需求工程的工程师和项目经理而言,这本书是一本不可或缺的好资料。
2. 《需求工程:基础》(Requirements Engineering: Fundamentals)- Klaus Pohl、Chris Rupp本书系统地介绍了需求工程的基本概念和方法,帮助读者全面理解需求工程的整个过程。
天津大学软件工程课程教学大纲

2. Course Description This course presents an introduction to the basic concepts of software, objects of
software engineering, traditional procedure-oriented soft development methods and object-oriented soft development methods, so students can master the method to develop high quality software. By learning the software develop process and process management techniques, students can understand how to conduct software metrics and management, how to take quality assurance activities, so the students can plan and manage software development activities effectively.
《软件工程——理论与实践(第三版)》,Pfleeger.S.L,Atlee.J.M.著,高等教 育出版社,2006 年 9 月。
制定人: 审核人: 批准人: 批准日期:
年月日
TU Syllabus for Software Engineering
Code:
2160288
Semester Hours: 56
Chapter 2 Software Process Software Process Model Component-Based Development Process RUP CMM
CCF推荐国际学术期刊

CCF推荐国际学术期刊中国计算机学会推荐国际学术期刊 (计算机系统与⾼性能计算)⼀、A类序号刊物简称刊物全称出版社⽹址1TOCS ACM Transactions on Computer Systems ACM2TOC IEEE Transactions on Computers IEEE3TPDS IEEE Transactions on Parallel and DistributedSystemsIEEE⼆、B类序号刊物简称刊物全称出版社⽹址1TACO ACM Transactions on Architecture and Code OptimizationACM2TAAS ACM Transactions on Autonomous andAdaptive SystemsACM3TODAES ACM Transactions on Design Automation ofElectronic SystemsACM4TECS ACM Transactions on Embedded ComputingSystemsnACM5TRETS ACM Transactions on ReconfigurableTechnology and SystemsACM6TOS ACM Transactions on Storage ACM7TCAD IEEE Transactions on COMPUTER-AIDEDDESIGN of Integrated Circuits and SystemsIEEE8TVLSI IEEE Transactions on VLSI Systems IEEE 9JPDC Journal of Parallel and Distributed Computing Elsevier 10 PARCO Parallel Computing Elsevier11Performance Evaluation: An InternationalJournalElsevier三、C类序号刊物简称刊物全称出版社⽹址1Concurrency and Computation: Practice andExperienceWiley2DC Distributed Computing Springer 3FGCS Future Generation Computer Systems Elsevier 4Integration Integration, the VLSI Journal Elsevier5 JSA The Journal of Systems Architecture: EmbeddedSoftware DesignElsevier6Microprocessors and Microsystems: EmbeddedHardware DesignElsevier7JGC The Journal of Grid computing Springer 8TJSC The Journal of Supercomputing Springer9JETC The ACM Journal on Emerging Technologies inComputing SystemsACM10JET Journal of Electronic Testing-Theory andApplicationsSpringer中国计算机学会推荐国际学术刊物(计算机⽹络)⼀、A类序号刊物简称刊物全称出版社⽹址1TON IEEE/ACM Transactions on Networking IEEE, ACM2JSAC IEEE Journal of Selected Areas inCommunicationsIEEE3TMC IEEE Transactions on Mobile Computing IEEE⼆、B类序号刊物简称刊物全称出版社⽹址1TOIT ACM Transactions on Internet Technology ACM2TOMCCAP ACM Transactions on Multimedia Computing, Communications and ApplicationsACM3TOSN ACM Transactions on Sensor Networks ACM4CN Computer Networks Elsevier5TOC IEEE Transactions on Communications IEEE6TWC IEEE Transactions on Wireless Communications IEEE三、C类序号刊物简称刊物全称出版社⽹址1Ad hoc Networks Elsevier2CC Computer Communications Elsevier3TNSM IEEE Transactions on Network and ServiceManagementIEEE4IET Communications IET 5JNCA Journal of Network and Computer Applications Elsevier 6MONET Mobile Networks & Applications Springer 7Networks Wiley 8PPNA Peer-to-Peer Networking and Applications Springer9WCMC Wireless Communications & Mobile Computing Wiley.10Wireless Networks Springer中国计算机学会推荐国际学术刊物 (⽹络与信息安全)⼀、A类序号刊物简称刊物全称出版社⽹址1TDSC IEEE Transactions on Dependable and SecureComputingIEEE2TIFS IEEE Transactions on Information Forensicsand SecurityIEEE3 Journal of Cryptology Springer⼆、B类序号刊物简称刊物全称出版社⽹址1TISSEC ACM Transactions on Information and SystemSecurityACM2 Computers & Security Elsevier3 Designs, Codes and Cryptography Springer4JCS Journal of Computer Security IOS Press三、C类序号刊物简称刊物全称出版社⽹址1CLSR Computer Law and Security Reports Elsevier2 EURASIP Journal on Information Security Springer3 IET Information Security IET4IMCS Information Management & Computer Security Emerald5ISTR Information Security Technical Report Elsevier6IJISP International Journal of InformationSecurity and PrivacyIdea GroupInc7IJICS International Journal of Information andComputer SecurityInderscience8SCN Security and Communication Networks Wiley中国计算机学会推荐国际学术刊物 (软件⼯程、系统软件与程序设计语⾔)⼀、A类序号刊物简称刊物全称出版社⽹址1TOPLAS ACM Transactions on ProgrammingLanguages & SystemsACM2TOSEM ACM Transactions on Software Engineering MethodologyACM3TSE IEEE Transactions on Software Engineering IEEE⼆、B类序号刊物简称刊物全称出版社⽹址1ASE Automated Software Engineering Springer2Empirical Software Engineering Springer3 TSC IEEE Transactions on Service Computing IEEE4 IETS IET Software IET5 IST Information and Software Technology Elsevier6JFP Journal of Functional Programming Cambridge University Press7Journal of Software: Evolution and Process Wiley8JSS Journal of Systems and Software Elsevier9RE Requirements Engineering Springer10SCP Science of Computer Programming Elsevier11SoSyM Software and System Modeling Springer12SPE Software: Practice and Experience Wiley13STVR Software Testing, Verification and Reliability Wiley三、C类序号刊物简称刊物全称出版社⽹址1Computer Languages, Systems and Structures Elsevier2IJSEKE International Journal on Software Engineering andKnowledge EngineeringWorld Scientific3STTT International Journal on Software Tools forTechnology TransferSpringer4Journal of Logic and Algebraic Programming Elsevier5JWE Journal of Web Engineering Rinton Press6Service Oriented Computing and Applications Springer 7 SQJ Software Quality Journal Springer8TPLP Theory and Practice of Logic Programming Cambridge University Press中国计算机学会推荐国际学术刊物 (数据库、数据挖掘与内容检索)⼀、A类序号刊物简称刊物全称出版社⽹址1TODS ACM Transactions on Database Systems ACM2TOIS ACM Transactions on Information andSystemsACM3TKDE IEEE Transactions on Knowledge and DataEngineeringIEEE ComputerSociety4VLDBJ VLDB Journal Springer-Verlag⼆、B类序号刊物简称刊物全称出版社⽹址1TKDD ACM Transactions on Knowledge Discoveryfrom DataACM2AEI Advanced Engineering Informatics Elsevier3DKE Data and Knowledge Engineering Elsevier4DMKD Data Mining and Knowledge Discovery Springer5EJIS European Journal of Information Systems The OR Society 6GeoInformatica Springer7IPM Information Processing and Management Elsevier8Information Sciences Elsevier9IS Information Systems Elsevier10JASIST Journal of the American Society for InformationScience and Technology American Society for Information Science andTechnology11JWS Journal of Web Semantics Elsevier12KIS Knowledge and Information Systems Springer13 TWEB ACM Transactions on the Web ACM三、C类序号刊物简称刊物全称出版社⽹址1DPD Distributed and Parallel Databases Springer2I&M Information and Management Elsevier3IPL Information Processing Letters Elsevier4Information Retrieval Springer5IJCIS International Journal of Cooperative InformationSystemsWorld Scientific6IJGIS International Journal of GeographicalInformation ScienceTaylor & Francis7IJIS International Journal of Intelligent Systems Wiley 8IJKM International Journal of Knowledge Management IGI9IJSWIS International Journal on Semantic Web andInformation SystemsIGI10JCIS Journal of Computer Information Systems IACIS 11JDM Journal of Database Management IGI-Global12JGITM Journal of Global Information TechnologyManagementIvy LeaguePublishing13JIIS Journal of Intelligent Information Systems Springer14JSIS Journal of Strategic Information Systems Elsevier中国计算机学会推荐国际学术刊物 (计算机科学理论)⼀、A类序号刊物简称刊物全称出版社⽹址1IANDC Information and Computation Elsevier2SICOMP SIAM Journal on Computing SIAM⼆、B类序号刊物简称刊物全称出版社⽹址1TALG ACM Transactions on Algorithms ACM2TOCL ACM Transactions on ComputationalLogicACM3TOMS ACM Transactions on MathematicalSoftwareACM4Algorithmica Springer 5Computational complexity Springer 6FAC Formal Aspects of Computing Springer 7Formal Methods in System Design Springer 8INFORMS Journal on Computing INFORMS9JCSS Journal of Computer and SystemSciencesElsevier10JGO Journal of Global Optimization Springer 11Journal of Symbolic Computation Elsevier12MSCS Mathematical Structures in ComputerScienceCambridgeUniversityPress13TCS Theoretical Computer Science Elsevier三、C类序号刊物简称刊物全称出版社⽹址1Annals of Pure and Applied Logic Elsevier2Acta Informatica Springer3Discrete Applied Mathematics Elsevier4Fundamenta Informaticae IOS Press5Higher-Order and SymbolicComputationSpringer6Information Processing Letters Elsevier 7JCOMPLEXITY Journal of Complexity Elsevier8LOGCOM Journal of Logic and ComputationOxford University Press9Journal of Symbolic Logic Association for Symbolic Logic10LMCS Logical Methods in Computer Science LMCS11SIDMA SIAM Journal on Discrete Mathematics SIAM12Theory of Computing Systems Springer中国计算机学会推荐国际学术期刊(计算机图形学与多媒体)⼀、A类序号刊物简称刊物全称出版社⽹址1TOG ACM Transactions on Graphics ACM2TIP IEEE Transactions on Image Processing IEEE3TVCG IEEE Transactions on Visualization andComputer GraphicsIEEE⼆、B类序号刊物简称刊物全称出版社⽹址1TOMCCAP ACM Transactions on MultimediaComputing, Communications andApplicationACM2CAD Computer-Aided Design Elsevier 3CAGD Computer Aided Geometric Design Elsevier 4CGF Computer Graphics Forum Wiley 5GM Graphical Models Elsevier6 TCSVT IEEE Transactions on Circuits andSystems for Video TechnologyIEEE7TMM IEEE Transactions on Multimedia IEEE8JASA Journal of The Acoustical Society ofAmericaAIP9SIIMS SIAM Journal on Imaging Sciences SIAM10SpeechComSpeech Communication Elsevier三、C类序号刊物简称刊物全称出版社⽹址1CAVW Computer Animation and Virtual Worlds Wiley2C&G Computers & Graphics-UK Elsevier3CGTA Computational Geometry: Theory andApplicationsElsevier4DCG Discrete & Computational Geometry Springer 5IET Image Processing IET 6IEEE Signal Processing Letter IEEE7JVCIR Journal of Visual Communication and Image RepresentationElsevier8MS Multimedia Systems Springer9MTA Multimedia Tools and Applications Springer10Signal Processing Elsevier11Signal procesing:image communication Elsevier12TVC The Visual Computer Springer中国计算机学会推荐国际学术刊物(⼈⼯智能与模式识别)⼀、A类序号刊物简称刊物全称出版社⽹址1AI Artificial Intelligence Elsevier2TPAMI IEEE Trans on Pattern Analysis and Machine IntelligenceIEEE3IJCV International Journal of Computer Vision Springer4JMLR Journal of Machine Learning Research MIT Press⼆、B类序号刊物简称刊物全称出版社⽹址1TAP ACM Transactions on Applied Perception ACM2TSLP ACM Transactions on Speech andLanguage ProcessingACM3Computational Linguistics MIT Press 4CVIU Computer Vision and Image Understanding Elsevier5DKE Data and Knowledge Engineering Elsevier6Evolutionary Computation MIT Press7TAC IEEE Transactions on Affective Computing IEEE8TASLP IEEE Transactions on Audio, Speech, andLanguage ProcessingIEEE9IEEE Transactions on Cybernetics IEEE10TEC IEEE Transactions on EvolutionaryComputation IEEE11TFS IEEE Transactions on Fuzzy Systems IEEE12TNNLS IEEE Transactions on Neural Networks andlearning systemsIEEE13IJAR International Journal of ApproximateReasoningElsevier14JAIR Journal of AI Research AAAI 15Journal of Automated Reasoning Springer16JSLHR Journal of Speech, Language, and HearingResearchAmericanSpeech-LanguageHearingAssociation17Machine Learning Springer18Neural Computation MIT Press19Neural Networks Elsevier20Pattern Recognition Elsevier三、C类序号刊物简称刊物全称出版社⽹址1TALIP ACM Transactions on Asian LanguageInformation ProcessingACM3Applied Intelligence Springer 4AIM Artificial Intelligence in Medicine Elsevier 5Artificial Life MIT Press6AAMAS Autonomous Agents and Multi-AgentSystemsSpringer7Computational Intelligence Wiley8Computer Speech and Language Elsevier9Connection Science Taylor & Francis10DSS Decision Support Systems Elsevier 11EAAI Engineering Applications of Artificial Intelligence Elsevier 12Expert Systems Blackwell/Wiley 13ESWA Expert Systems with Applications Elsevier 14Fuzzy Sets and Systems Elsevier15T-CIAIG IEEE Transactions on ComputationalIntelligence and AI in GamesIEEE16IET Computer Vision IET 17IET Signal Processing IET 18IVC Image and Vision Computing Elsevier 19IDA Intelligent Data Analysis Elsevier20IJCIA International Journal of ComputationalIntelligence and ApplicationsWorld Scientific21IJDAR International Journal on Document Analysisand RecognitionSpringer22IJIS International Journal of Intelligent Systems Wiley23IJNS International Journal of Neural Systems World Scientific24IJPRAI International Journal of Pattern Recognitionand Artificial IntelligenceWorld Scientific25International Journal of Uncertainty,Fuzziness and KBSWorld Scientific26JETAI Journal of Experimental and TheoreticalArtificial IntelligenceTaylor & Francis27KBS Knowledge-Based Systems Elsevier 28Machine Translation Springer 29Machine Vision and Applications Springer 30Natural Computing Springer31NLE Natural Language Engineering Cambridge University32NCA Neural Computing & Applications Springer 33NPL Neural Processing Letters Springer 34Neurocomputing Elsevier 35PAA Pattern Analysis and Applications Springer 36PRL Pattern Recognition Letters Elsevier 37Soft Computing Springer38WIAS Web Intelligence and Agent Systems IOS Press中国计算机学会推荐国际学术期刊(⼈机交互与普适计算)⼀、A类序号刊物简称刊物全称出版社⽹址1TOCHI ACM Transactions on Computer-HumanInteractionACM2IJHCS International Journal of Human Computer Studies Elsevier⼆、B类序号刊物简称刊物全称出版社⽹址1CSCW Computer Supported Cooperative Work Springer2HCI Human Computer Interaction Taylor & Francis3IWC Interacting with ComputersOxford University Press4UMUAI User Modeling and User-Adapted Interaction Springer三、C类序号刊物简称刊物全称出版社⽹址1BIT Behaviour & Information Technology Taylor & Francis2IJHCI International Journal of Human-ComputerInteractionTaylor & Francis3PMC Pervasive and Mobile Computing Elsevier4PUC Personal and Ubiquitous Computing Springer中国计算机学会推荐国际学术期刊(前沿、交叉与综合)⼀、A类序号刊物简称刊物全称出版社⽹址1Proc. IEEE Proceedings of the IEEE IEEE2JACM Journal of the ACM ACM⼆、B类序号刊物简称刊物全称出版社⽹址1Bioinformatics Oxford UniversityPress2Briefings in Bioinformatics Oxford UniversityPress3Cognition Cognition:International Journal ofCognitive ScienceElsevier4PLOS Computational Biology Public Libraryof Science5TMI IEEE Transactions on Medical Imaging IEEE6TGARS IEEE Transactions on Geoscienceand Remote SensingIEEE7TITS IEEE Transactions on IntelligentTransportation SystemsIEEE8TR IEEE Transactions on Robotics IEEE9TASAE IEEE Transactions on AutomationScience and EngineeringIEEE10JCST Journal of Computer Science andTechnologySCIENCEPRESS/Springer11JAMIA Journal of the American MedicalInformatics AssociationBMJ Journals12Science China Information Sciences Science in China Press/Springer13The Computer Journal Oxford UniversityPress三、C类序号刊物简称刊物全称出版社⽹址1BMC Bioinformatics BioMed Central2Cybernetics and Systems Taylor & Francis3IEEE Geoscience and RemoteSensing LettersIEEE4TITB IEEE Transactions on InformationTechnology in BiomedicineIEEE5TCBB IEEE-ACM Transactions onComputational Biology andBioinformaticsIEEE/ACM6IET Intelligent Transport Systems IET 7Medical Image Analysis Elsevier8FCS Frontiers of Computer Science Higher EducationPress。
形式化方法 参考书
形式化方法参考书以下是一些关于形式化方法的参考书籍:1. 《软件工程——形式化方法》(Software Engineering: Formal Methods)- Jean-Raymond Abrial2. 《形式化方法:计算机科学和工程的形式化技术》(Formal Methods for Computing Science and Engineering: Theory & Practice)- John Harrison3. 《形式化方法和软件工程:基础和应用》(Formal Methods and Software Engineering: Foundations and Applications)- Tim Denvir, John Fitzgerald, Peter Gorm Larsen4. 《软件工程中的形式化方法:数学理论和实际应用》(Formal Methods in Software Engineering: Mathematical Theory and Practical Applications)- Ke Sun, Chunbo Luo, Denggui Zhang5. 《计算机科学的形式化方法》(Formal Methods in Computer Science)- Carroll L. Morgan6. 《实时系统的形式化方法》(Formal Methods for Real-Time and Probabilistic Systems)- Marco Bernardo, Rocco De Nicola7. 《形式化方法:基本概念和技术》(Formal Methods: Concepts and Techniques)- Andrew Ireland8. 《形式化方法和工具:软件工程的逻辑基础》(Formal Methods and Tools: Applications to Software Engineering)- Jean-Pierre Jouannaud, Josef Sifakis9. 《形式化方法在软件工程中的应用》(Formal Methods Applied to Software Engineering)- Jan Camenisch, David L. Dill 10. 《企业应用系统的形式化方法》(Formal Methods forEnterprise Systems)- Rami Bahsoon, Natalia Sidorova, Antonino Sabetta这些参考书籍涵盖了形式化方法在软件工程、计算机科学和工程等领域的理论和应用方面的知识,对于对形式化方法感兴趣的读者来说是很好的参考资料。
SOFTWARE---PRACTICE AND EXPERIENCE, VOL. 29(0), 1--4 (0 1999) A Killer Adversary for Quicks
SOFTWARE—PRACTICE AND EXPERIENCE,VOL.29(0),1–4(01999)A Killer Adversary for QuicksortM.D.M C ILROYDartmouth College,Hanover,NH03755,USASUMMARYQuicksort can be made to go quadratic by constructing input on thefly in response to the sequence of items compared.The technique is illustrated by a specific adversary for the standard C qsort function. The general method works against any implementation of quicksort–even a randomizing one–that satisfies certain very mild and realistic assumptions.When using quicksort one often feels a nagging tension:suppose it goes quadratic?Tactics to avoid embarrassing results in some low-entropy cases,such as already ordered input,are cited in most al-gorithms books12and are widely used.Nevertheless,production implementations have been caught going quadratic in real-life applications.3No matter how hard implementers try,they cannot(without great sacrifice of speed)defend against all inputs.This note describes an adversarial method thatfinds chinks in the defenses of any implementation.A polymorphic implementation of quicksort,such as the standard C function qsort,never looks at the data.It relies instead on an externally supplied comparison function.And that allows us to monitor and influence the program’s progress noninvasively.To do so we make a comparison function that observes the pattern of comparisons and constructs adverse data on thefly.Recall that quicksort sorts a sequence of n data items in three phases:1.Pick a data item as pivot.We assume that this phase uses O(1)comparisons.2.Partition the data into three parts that respectively contain all items less than the pivot,the pivotitem itself,and all items greater than the pivot.The placement of items equal to the pivot varies among implementations.3.Recursively sort the low and high parts.An adversary can make such a quicksort go quadratic by arranging for the pivot to compare low against almost all items not seen during pivot selection,so the partition will be lopsided.Those items may be regarded as a“gas”of values whose relationship to each other is unknown.The exact values don’t matter as long as they are not compared against each other.Quadratic behavior is guaranteed since n−O(1)gas values must survive pivot selection among n items.Almost all partition high. Initially the adversary makes all items gas.When two gas items are compared,one gets“frozen”into a definite“solid”value,greater than any already solid value.Then the operands are compared afresh. When a solid item is compared to a gas item,it compares low.When two solid items are compared,the answer depends on the frozen values.The essential trick is to make sure that the pivot gets frozen early in the partition phase if it has not already been frozen.No further gas items will become frozen as long as the pivot is involved in every comparison–that is,for the duration of the partitioning phase.A simple heuristic suffices to guess the pivot and freeze it.A“pivot candidate”is the gas item that most recently survived a comparison.When an item is to be frozen(in a gas-gas comparison)a pivot CCC0038–0644/99/000001–04Received1998 c 1999by John Wiley&Sons,Ltd.Revised19982M.D.MCILROYcandidate is preferred.While there may be no useful pivot candidate at the start of the partition phase, one will emerge as soon as a gas item is examined.If the pivot is already solid,the candidate doesn’t matter.Otherwise,thefirst gas-gas comparison in the partition phase results in the pivot either getting frozen or becoming the pivot candidate.In the worst case the pivot will become frozen at the second gas-gas comparison in the partitioning phase.With at most two items getting frozen during partitioning, we are still assured that n−O(1)items will partition high.To defend against the possibility of the subject quicksort working on copied data that may not see changes that the adversary makes,we let the subject sort pointers to immovable items instead of the items themselves.The subject and the adversary are protected from each other because the subject works on pointers while the adversary works on items.When the pointers havefinally been rearranged into sorted order,the array of items holds the constructed input that drove quicksort quadratic.The adversarial method works for almost any polymorphic program recognizable as quicksort.The subject quicksort may copy values at will,or work with lists rather than arrays.It may even pick the pivot at random.The quicksort will be vulnerable provided only that it satisfies some mild assumptions that are met by every implementation I have seen:1.The implementation is single-threaded.2.Pivot-choosing takes O(1)comparisons;all other comparisons are for partitioning.3.The comparisons of the partitioning phase are contiguous and involve the pivot value.4.The only data operations performed are comparison and copying.parisons involve only input data values or copies thereof.An invasive version of the method may be used when the caller does not control the comparison function,by bugging the comparison steps in quicksort itself.The Appendix shows an adversary for C’s qsort.The function antiqsort(n,a)constructs in array a a bad permutation of0..n−1and returns the number of comparisons qsort took to sort it. Gas is coded as the top value,n−1,which ultimately persists in the single item that survives the last gas-gas comparison.The pointers described above are realized as indexes into an array of item values. In accordance with the C standard,the arguments of the comparison function are C pointers to these index“pointers”.The adversary is effective,as parison counts C(n)were measured at single values of n where C(n)>107,with quadratic behavior confirmed by the truth of C(n)>3.99C(n/2). Remember that the table describes the effectiveness of a particular adversary,not the ultimate worst-case behavior of the implementations.Table1.Performance of antiqsort against various qsort s.Implementation Pivot choice Approximate countDigital Unix4.0Arbitrary0.25n2(exact)Irix6.4Median of three0.25n2Bentley Median of medians0.088n2gcc2.7(Windows)?0.097n2Against the qsort in Digital Unix antiqsort generates inputs exemplified by Figure1.These inputs force exactly⌈n2/4⌉comparisons for n>3.This qsort chooses a pivot arbitrarily as the middle item in the array.By luck,it causes the adversary to freeze two items per partition–themaximum possible.Thus the size of the high side of the partition decreases by two at each recursion level.The recursion continues right down to n=1.If n is even,the total number of comparisons at all levels is(n−1)+(n−3)+...+1,a sum of odd numbers and hence a perfect square,as observed.AnA KILLER ADVERSARY FOR QSORT 316324864Figure 1.A 64-item adverse input for Digital Unix qsort .An end effect sets the order of items 31and 63.Pivots,with odd values,form the right staircase.The remaining items,with even values,form 5interleaved staircases with steps at 2k −1mod 2k +1,for k =0..4.Each item in staircase k gets swapped with k different pivots during sorting.unlucky implementation would cause only one item to be frozen at each level,giving almost twice as many comparisons.Any other arbitrary pivot choice,such as the first item or a random item,would yield similar results.Somewhat surprisingly,Table 1shows a median-of-three quicksort 2doing no better than the (lucky)arbitrary-choice quicksort.To see why,notice that two items get frozen during an optimum computation of the median of three.One partitions low and the other is the median.Hence the size of the high side decreases by two at each level,as with arbitrary choice.The median calculation is wasted effort.The adversary cannot push the comparison count of Bentley’s qsort 3as high,because that program considers–and freezes–more items in choosing a pivot.When all considered items are gas,as is likely,the high side of the partition shrinks by six per recursion level.Thus the comparison count should be nearly a factor of 3less than that for a median-of-three choice.Table 1confirms this prediction.The adversary is highly specific to quicksort.Against an insertion sort it did as badly as possible,forcing only n −1comparisons to sort n items.I thank Jon Bentley for critical reading and the referees for prompting the presentation of results.REFERENCES1.Jeffrey H.Kingston,Algorithms and Data Structures:Design,Correctness,Analysis ,Addison-Wesley,1990.2.R.Sedgewick,Algorithms in C++,Addison-Wesley,1992.3.J.L.Bentley and M.D.McIlroy,‘Engineering a sort function’,Software–Practice and Experience ,23,1249–1265(1993).4M.D.MCILROYAppendix.An adversary for qsort.#include<stdlib.h>int*val;/*item values*/int ncmp;/*number of comparisons*/ int nsolid;/*number of solid items*/ int candidate;/*pivot candidate*/int gas;/*gas value*/#define freeze(x)val[x]=nsolid++int cmp(const void*px,const void*py)/*per C standard*/{const int x=*(const int*)px;const int y=*(const int*)py;ncmp++;if(val[x]==gas&&val[y]==gas)if(x==candidate)freeze(x);elsefreeze(y);if(val[x]==gas)candidate=x;else if(val[y]==gas)candidate=y;return val[x]-val[y];/*only the sign matters*/ }int antiqsort(int n,int*a){int i;int*ptr=malloc(n*sizeof(*ptr));val=a;gas=n-1;nsolid=ncmp=candidate=0;for(i=0;i<n;i++){ptr[i]=i;val[i]=gas;}qsort(ptr,n,sizeof(*ptr),cmp);free(ptr);return ncmp;}。
slides01-01
© 2006 Pearson/Prentice Hall
Page 1.16
1.5 Systems Approach
The Element of a System • Activities and objects
Pfleeger and Atlee, Software Engineering: Theory and Practice
© 2006 Pearson/Prentice Hall
Page 1.15
1.5 Systems Approach
• Identify activities and objects • Define the system boundary
Solving Problems (continued) • Method: refers to a formal procedure • Tool: an instrument or automated system for accomplishing something in a better way • Procedure: a combination of tools and techniques to produce a product • Paradigm: philosophy or approach for building a product
Pfleeger and Atlee, Software Engineering: Theory and Practice
© 2006 Pearson/Prentice Hall
Page 1.8
1.2 How Successful Have We Been?
01 What is Software
Pfleeger and Atlee, Software Engineering: Theory and Practice © 2006 Pearson/Prentice Hall
Page 1.9
1.2 How Successful Have We Been?
• Perform tasks more quickly and effectively
Page 1.5
1.1 What is Software Engineering?
Solving Problems (continued)
• The synthesis process
Pfleeger and Atlee, Software Engineering: Theory and Practice © 2006 Pearson/Prentice Hall
Pfleeger and Atlee, Software Engineering: Theory and Practice © 2006 Pearson/Prentice Hall
Page 1.2
Objectives
• What we mean by software engineering • Software engineering’s track record • What we mean by good software • Why a systems approach is important • How software engineering has changed since
• A fault: occurs when a human makes a mistake, called an error, in performing some software activities