张惠舜
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Software Architecture - Essay 3 === OBS Studio was started in 2013 by Hugh "Jim" Bailey and quickly grew with the help of many online collaborators working to improve the software. In the present day, the software is community-driven with over 400 contributors. Because there is no real company, the autonomy must be very solid for the software development to run well This essay is divided into 7 sections, the structure of the essay is: - [Software quality process](#p1) - [Continuous integration](#p2) - [Testing](#p3) - [Hotspot components](#p4) - [Code quality](#p5) - [The quality culture](#p6) - [Technical debt](#p7) ## <span id="p1">Software quality process</span> A method to ensure the development of OBS Studio is the use of software quality processes and how they are applied. This section will cover this concept. ### Forking In order for developers to contribute to the software, they need to fork the Github repository. Forking is creating a copy of a repository where you can freely experiment with changes without actually affecting the original project [^githubfork]. To add to the original project, the developer then has to create a branch from their fork and submit a pull request from that branch into the master branch of the original Github project. Such a pull request needs to be reviewed by other developers that in turn decide whether they accept, reject, or request changes for the pull request. ### Pull request In OBS Studio's case, you also need to provide detailed information about the pull request together with a checklist that is checked off. The detailed information entails a description of the pull request, motivation, and context as to why the changes were made, the way the changes have been tested, and the types of changes that are made (e.g. Bug fix, documentation, etc.). The checklist consists of the following tasks: - My code has been run through the clang-format - I have read the contributing document - My code is not in the master branch - The code has been tested - All commit messages are properly formatted and commits squashed where appropriate. - I have included updates to all appropriate documentation. The clang-format is about the continuous integration that is applied, which will be addressed in the next section. The contributing document shows a list of coding conventions OBS Studio developers must abide by. #### Coding For coding these consist of using the kernel normal form which is a specific coding style, avoiding trailing spaces, tabs needing to be used for indentation, and a line of code not being longer than 80 columns. #### Committing For committing these changes are as follows; make use of the 50/72 standard for commits, which means 50 maximum of 50 characters for a commit message, and a full description afterward, wrapped to 72 columns. Titles should be in the present tense, prefix each commits title with the module name it addresses followed by a colon and a space [^guideline]. ## <span id="p2">Continuous integration</span> Together with the aforementioned conditions that need to hold to contribute, there is also the continuous integration that is applied when making an addition. This section will cover the key elements of OBS Studio's continuous integration processes. The development team has decided that for each pull request that is made, there are 12 checks divided over 4 tools that are used for the CI. These parts are `Flatpak`, `CI Multiplatform Build`, `Azure pipeline`, and `Clang-format`. ### Flatpak Flatpak is a utility for software deployment and package management for Linux. It is advertised as offering a sandbox environment in which users can run application software in isolation from the rest of the system. This way OBS Studio can do some quick end-to-end testing when deploying their software on Linux[^flatpak]. ### CI Multiplatform Build They build the latest version on the possible platform OBS Studio is capable of running on. That is, they build the latest version on macOS 64-bit, Linux/Ubuntu 64-bit, Windows 32-bit, and Windows 64-bit. They do this by installing all parts needed to run the software on the specific platform which is specified in `main.yml`[^multiplatform]. ### Azure pipeline Azure Pipelines automatically builds and tests code projects to make them available to others. Azure Pipelines combines continuous integration (CI) and continuous delivery (CD) to constantly and consistently test and build the code[^azure]. ### Clang-format Clang is a compiler front end for C, C++, and several other programming languages. It is mainly used to compile the code and run `formatcode.sh` using `clang-format.yml` which is a script that checks the code quality. That is, it looks at whether the code is in line with the coding conventions[^github]. Next to the checks there also other actions performed in the workflow. These are `CI AppImage Build` and `Generate Documentation` . ### CI AppImage Build AppImage allows users to download an application and run it on a Linux desktop system just like in Windows or Mac applications. So it is a check to see whether providing the packages for OBS Studio for Linux desktop systems will result in any errors. They do so by running `build-appimage.yml`[^appimage]. ### Generate Documentation As the name suggests, it generates documentation for the specified places in the project. This is done running `docs.yml`[^generatedoc]. ## <span id="p3">Testing</span> Unfortunately, in the development of OBS Studio, automated testing is not one of the priorities. The compiling and building of the software product is the main way of testing. There is also a test folder with several general tests. But these are not nearly enough to test the whole system. When submitting a pull request all changes are mainly manually tested by the contributor and the reviewer(s)[^github]. ## <span id="p4">Hotspot components</span> This section will discuss the components that involved in many code changes from the past and the potential future hotspot components. We visualize the quality of OBS by the tool of CodeScene[^codescene]. From the past code changes, the top three hotspot components are: `plugins`, `UI`, and `libobs`. `plugins` is the one contains all the official plugins of OBS studio, thus it's reasonable that `plugins` is one of the hotspot. The interface of OBS is supported by Qt, hence, the commits of `UI` contains the cleanups for new versions of Qt framework. The components of `libobs` is the library of OBS, thus the commits contains a large amount of code cleanups and minor fixes. ![](https://i.imgur.com/Dw7UE84.png) <p style="text-align:center; font-size: 12px;"><i><strong>Figure 1:</strong> Hotspot component of OBS studio</i></p> Among all the files of OBS, the most frequently changes one is the `window-basic-main.cpp` from `UI` component, with a change frequency of 106 commits. Further analysis of the code quality will be discussed in [next section](#p5). As for hotspot in the future, there're no new big features planned for next version, the future work will mainly be improving the system, thus hotspots will focus on the `plugins` components to add more features and fixing issues of other components. ## <span id="p5">Code quality</span> This section focus on the code quality of hotspot components discussed on [previous section](#p4). Among all the hotspot components, the `window-basic-main.cpp` file of `UI` component is the one with most defect commits, which has 47 commits of defect and takes 44% of the total commits in this file. ![](https://i.imgur.com/HtCO9Oc.png) <p style="text-align:center; font-size: 12px;"><i><strong>Figure 2:</strong> Hotspots in UI component</i></p> According to the analysis of CodeScene[^codescene], the least healthy codes of all the files are all in `UI` component, with the problems of bumpy road and deeply nested complexity, which means this code has multiple nested conditional logic inside the same function. However, in `UI` component, it's essential to check the conditions of every settings and transmit these to back end functions, hence, some of the functions in `UI` needs to check these conditions by if-statement in sequence. Therefore, the poor score of `UI` component does not represent serious problems of source code. ## <span id="p6">The quality culture</span> The quality culture of OBS Studio is maintained by the entire community. Some useful guide documents[^guideline] are provided on github for contributors to follow. In these documents, they describe some principles of coding and commit format. In the issues and pull requests of OBS studio, there is a tag "code cleanup" which is specified for those contributions on structure refactoring and code cleaning. The fact that 160 "code cleanup" issues and pull requests accounted for a large proportion of the total reflects the community's emphasis on code maintainability and quality. And we will take one of the pull requests as examples for specific analysis. As described in this pull request[^hotkey], the hotkey interface need to be redesigned as a plugin rather than embeded in core module and RFC is used to integrate all control plugin modules. The first reason of this refactoring is that the hotkey code is mixed with others in sevearal files which is against maintainability. The other reason is that using RFC allows hotkeys to control and communicate with other input and output plugin modules[^RFC]. This code refactoring is consistent with the design concept of the entire project, that is, modular plug-inization. Through this plug-in idea, the entire project becomes very extensible and maintainable. Becides, some comments under pull requests posted by developers also reflect their awareness of quality culture. One of the examples can be: ![](https://i.imgur.com/3PnU8nV.png) <p style="text-align:center; font-size: 12px;"><i><strong>Figure 3: </strong>Comment by OBS Studio developers</i></p> ## <span id="p7">An assessment of technical debt present in the system.</span> The current system has little techincal debt, which is the consequence of a complete rework of the entire system and the emphasis on maintainability afterwards. Like we discussed earlier there is a lot of focus on the code quality as seen from all the code cleanup PRs. As well as the maintainance of it by ensuring strict rules for all changes to the system. And even though there are no current plans for major new features this should not give too much of a hassle similar to how smaller features are also implemented fairly easily. This was completly different back in 2016 when the developers wanted to add multi-platform support and realised that the system was compeltly hard coded for windows and there was no way it would work on other systems[^refractor]. Furthermore the developers also saw major techincal and coding flaws that which hindered the developers in maintaining the system and adding new features. They are all addressed in [^refractor] but we will take a look at the main ones. The main design flaws were caused by either not planning well enough or hardcoding particular features/components. This was generally because the developer didnt anticipate his project becoming so big and he just wanted to create a simple streaming software. Therefore he only added certain features later on such as the API, but these were generally hard to implement and were hacked into the project. With the rework the core developer had way more expierence with all the sub-systems and there was now also a community to help out. Thus he set out some of the main goals for the rework: * Making it multi platform since that was the feature they wanted to add before realizing how bad their system was designed. * Seperating the components more and simplifying the particular complext ones. This would make them easier to use and more maintanable. * Creating a new API and making it modular. * Improving the overall design, minimizing the design flaws and to ensure that certain features, which could not be added before, can now easily be added. Furthermore were there also some major coding flaws, which the rework intended to resolve. The main problems were inconsistent style, too many custom classes which re-invented the wheel and classes and methods that were too large and did too many things at once. That is why they introduced such strict guidelines which they still use currently and are already mentioned in this essay. So it is clear to see that there was a lot of technical debt in the system and they decided that rewriting the entire system with clear guidelines and a strict code style in mind would repay the debt and give them a clean slate. So that is indeed what they did and the guidelines were already mentioned in the section about PR quality. And this has given the current system with very little debt remaining, because you can never remove all of it for everyone at least. ## Reference [^guideline]: [OBS contributing guidelines](https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst) [^hotkey]:[Hotkey pull request](https://github.com/obsproject/rfcs/pull/28) [^RFC]:[RFC](https://github.com/cpyarger/rfcs/blob/master/text/0028-reimplementation-of-hotkeys-to-controls.md) [^refractor]: [Objective of OBS refactoring](https://github.com/alesaccoia/chew-broadcaster/blob/master/README) [^githubfork]:[OBS Github forking](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) [^github]:[OBS Github](https://github.com/obsproject/obs-studio) [^azure]:[Azure pipeline](https://docs.microsoft.com/nl-nl/azure/devops/pipelines/get-started/what-is-azure-pipelines?view=azure-devops) [^multiplatform]:[CI Multiplatform Build](https://github.com/obsproject/obs-studio/actions?query=workflow%3A%22CI+Multiplatform+Build%22) [^flatpak]:[Flatpak](https://flatpak.org/) [^appimage]:[AppImage](https://appimage.org/) [^generatedoc]:[Generate documentation](https://github.com/obsproject/obs-studio/actions/workflows/docs.yml) [^codescene]:[CodeScene](https://codescene.io/)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully