Advertisement
Поиск  
Always will be ready notify the world about expectations as easy as possible: job change page
Oct 21, 2023

Input Kludge

Источник:
Просмотров:
653

AntiPattern Problem

Software that fails straightforward behavioral tests may be an example of an Input Kludge, which occurs when ad hoc algorithms are employed for handling program input.

For example, if the program accepts free text input from the user, an ad hoc algorithm will mishandle many combinations of legal and illegal input strings. The anecdotal evidence for an Input Kludge goes like this: "End users can break new programs within moments of touching the keyboard."

Input

Refactored Solution

For nondemonstration software, use production-quality input algorithms. For example, lexical analysis and parsing software is readily available as freeware. Programs such as lex and yacc enable robust handling of text comprised of regular expressions and context-free language grammars. Employing these technologies for production-quality software is recommended to ensure proper handling of unexpected inputs.

Variation

Many software defects arise due to unexpected combinations of user-accesible features. Employing a feature matrix is recommended for sophisticated applications with graphical user interfaces.

A feature matrix is state information in the program used to enable and disable features prior to user actions. When the user invokes a feature, the feature matrix indicates which other features must be disabled in order to avoid conflicts. For example, a feature matrix is often used to highlight and unhighlight menu commands prior to displaying the menu.

Background

Programmers are trained to avoid input combinations that cause program and system crashes. In a hands-on training course on OpenDoc, we used a preliminary alpha release of the technology that was not yet sufficiently robust for production-quality development. In other words, it was easy to crash the entire operating system with seemingly correct sequences of input commands and mouse operations.

The students spent the first day experiencing numerous system crashes and waiting for system reboot. After attending the "crashing labs," we wondered whether the release was robust enough to enable any kind of sophisticated software development. By the end of the week, we had learned to work around the limitations and perform programming tasks and input operations that went well beyond our expectations formed the first day. We had internalized the input sequences that avoided system crashes.

Похожее
Jun 29, 2023
Author: Megha Prasad
Attributes and decorators, which allow you to attach metadata to classes, properties, and methods.AttributesAttributes in C# allow you to attach metadata to your classes, methods, and other code elements. This metadata can then be used at runtime to modify the...
Dec 1, 2023
Author: Shachar Shamir
 While sometimes there’s nothing to do but crack open that energy drink and grind out an all-nighter, coders tend to work smarter, not harder by finding ways to increase their productivity without sacrificing work quality. No matter what specific industry...
May 29, 2023
Maximizing performance in asynchronous programmingTask and Task<TResult>The Task and Task<TResult> types were introduced in .NET 4.0 as part of the Task Parallel Library (TPL) in 2010, which provided a new model for writing multithreaded and asynchronous code.For demonstration purposes, let’s...
Jul 24, 2023
Author: Mario Bittencourt
We have been living in a distributed world for quite some time, and when considering how should you implement the communication between any two parties involved, the discussion seems to gravitate around two options: API or messaging.Instead of focusing on...
Написать сообщение
Почта
Имя
*Сообщение


© 1999–2024 WebDynamics
1980–... Sergey Drozdov
Area of interests: .NET Framework | .NET Core | C# | ASP.NET | Windows Forms | WPF | HTML5 | CSS3 | jQuery | AJAX | Angular | React | MS SQL Server | Transact-SQL | ADO.NET | Entity Framework | IIS | OOP | OOA | OOD | WCF | WPF | MSMQ | MVC | MVP | MVVM | Design Patterns | Enterprise Architecture | Scrum | Kanban